Microsoft Operations Manager

GetUserNameFromSessionID Method

The GetUserNameFromSessionIDmethod gets the user name from a specified session ID.

[VBScript]
TermServer.GetUserNameFromSessionID(SessionID Variant, UserName
Variant, [ComputerName Variant])

Parameters

SessionID
Specifies the ID of the session.
UserName
Specifies the name of the user associated with the SessionIDparameter.
ComputerName
Specifies the target computer. This parameter is optional. If the target computer is not specified or the parameter is an empty string, the local computer is the target.

Return Value

Boolean

Examples

The following example shows how to get the user name associated with the given session ID.

[VBScript] 
Function GetAccountName(lngSessionID)
	Dim objTermServer, blnOK, strUserName

	Set objTermServer = CreateObject("OpScrUtil.TermServer")

	blnOK = objTermServer.GetUserNameFromSessionID(lngSessionID,
strUserName)
	If (blnOK = False) Then 
		strUserName = "GetUserNameFromSessionID Failed. The error
is " & objTermServer.GetError()
	End If

	Set objTermServer = Nothing

	GetAccountName = strUserName
End Function

Requirements

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

See Also

TermServer Object


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