OpsMgr Script Tip: Making sure your script is executing with the proper credentials

SCOMAgent Here’s a script snippet I needed just a moment ago thought worth sharing. I needed a customer to verify an OpsMgr script in a custom MP was running with the credentials they thought it expected (the MP had a Run As Profile included). The first thing that came to mind was two write the identity running the process out to the OpsMgr Event Log. I actually found inspiration for how to handle this in a forum thread from Zaki Maksyutov [MSFT] and added a couple of bits to meet the desired end.

Just tack this snippet on to the front of the VBScript you’re testing…Remove when you’re done.

The resultant event is pretty simple and to the point.

image

 

More OpsMgr Scripting Resources

We have quite a few scripts and such in the Downloads section for sure. Here’s a page with just a few of my favorite sample scripts, articles and tutorials for OpsMgr and Essentials runtime scripting.

Links: OpsMgr 2007 Scripting Articles at System Center Central

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.