Using a specific account for specific scripts in SCOM 2007
In System Center Operations Manager 2007 you can choose an action account per server. Some management packs provide the possibility to choose a different account for some tasks. However, if you just want to run a specific script with a specific user account, the SCOM environment doesn’t provide default options to choose an account. There is a way to bypass the default behaviour in SCOM 2007 and provide your own account for a specific check.
Find out how
To prepare for a specific monitoring user follow these steps:

Create a monitoring profile

Now create your monitor (in the authoring section).
See for basic instructions on how to create a monitor one of my previous posts: http://www.cupfighter.net/index.php/2009/10/check-your-sql-backup-automatically/
Here is a sample script with some basic options for passing the output to the eventlog and to SCOM itself to set the state of the monitor and generate alerts. The script also contains some code to determine the user account that is used.
Option Explicit
Dim checkdotcomma, strStatus
Dim objAPI, propertyBag
Dim objWMIService, colProcesses, objProcess
Dim strCurrentUser, User, Domain, strUserList
On Error Resume next
Const EVENT_TYPE_ERROR = 1
Const EVENT_TYPE_WARNING = 2
Const EVENT_TYPE_INFORMATION = 4
‘ Check if we are using the correct user for this check
Set objWMIService = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2″)
Set colProcesses = objWMIService.ExecQuery(“select * from win32_process where Name=’cscript.exe’”)
For Each objProcess in colProcesses
If objProcess.GetOwner (User, Domain ) = 0 Then
strCurrentUser = “Script has run under account: ” & Domain & “\” & User
Else
strCurrentUser = “Problem getting the owner for process ” & objProcess.Caption
End If
strUserList = strUserList & strCurrentUser
Next
Set objAPI = CreateObject(“MOM.ScriptAPI”)
‘ perform check on regional settings if numbers are using dots or commas
‘ replace this with your own code you want to run
checkdotcomma = Mid(1/2,2,1)
If checkdotcomma = “.” Then
strStatus = “Ok”
Call objAPI.LogScriptEvent(“CheckDotComma”,2000, EVENT_TYPE_INFORMATION,”Regional Settings are using a Dot (.). The user list is ” & strUserList )
Else
strStatus = “Error”
Call objAPI.LogScriptEvent(“CheckDotComma”,2001, EVENT_TYPE_ERROR, “Regional Settings are using a Comma (,). The user list is ” & strUserList )
End if
‘ return status to monitor
Set propertyBag = objAPI.CreatePropertyBag ()
Call propertyBag.AddValue (“Status”, strStatus)
Call propertyBag.AddValue (“checkdotcomma”, checkdotcomma)
Call objAPI.Return(propertyBag)
Download the System Center Operations Manager 2007 Authoring Console

To make it bit more nice, export your management pack, and look up the Secure References.
Replace all instances of the SecureReference ID with a more readable format, see below.
<SecureReferences>
<SecureReference ID="MonitoringUser" Accessibility="Internal" Context="System!System.Entity" />
</SecureReferences>
Reimport your managementpack and you are all set.