Microsoft Operations Manager

GetError Method (SCManager)

The GetErrormethod gets the most recent error description for the SCManagerobject.

[VBScript] SCManager.GetError()

Return Value

String

Examples

The following example shows how to get an error after a function fails.

[VBScript] 
Function StartMessengerService()
	Dim objSCManager
	Dim strErrorMsg

	Set objSCManager = CreateObject("OpScrUtil.SCManager")

	If (objSCManager.StartService("messenger")) Then
		strErrorMsg = ""
	Else
		strErrorMsg = "Service did not start. The error is " &
objSCManager.GetError()
	End If

	Set objSCManager = Nothing

	StartMessengerService = strMsg
End Function

Requirements

Windows NT/2000: Requires Windows 2000 or later
Version: Requires MOM 1.0 SP1

See Also

SCManager Object


Did you find this information useful? Please send your suggestions and comments about the documentation to momsdk@microsoft.com.