Microsoft Operations Manager

GetSessionIDFromWinStation Method

The GetSessionIDFromWinStationmethod gets the unique identifier (ID) of a session from a given WinStationname.

[VBScript]
TermServer.GetSessionIDFromWinStation(WinStation Variant, sessionID
Variant, [ComputerName Variant])

Parameters

WinStation
Name of the specified session.
SessionID
Session identifier.
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 session ID for a given session name.

[VBScript] 
Function GetSessionID(strWinStationName)
	Dim objTermServer, lngSessionID, blnOK

	Set objTermServer = CreateObject("OpScrUtil.TermServer")

	blnOK =
objTermServer.GetSessionIDFromWinStation(strWinStationName,
lngSessionID)
	If Not(blnOK) Then 
		lngSessionID = -1
	End If

	Set objTermServer = Nothing

	GetSessionID = lngSessionID
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.