GetSessionIDFromWinStation Method

Gets the unique identifier (ID) of a session from a given WinStation name.


  obj.GetSessionIDFromWinStation(WinStation string,sessionID long,
  [ComputerName string])where obj is an OpScrUtil.TermServer object 


WinStation Name of the Specified Session
SessionID Session Identifier
ComputerName Specifies the target computer. This parameter is optional. If not specified or an empty string, the local computer is the target.

Return Type



To get the SessionId for a given SessionName(WinStationName), enter:

	 Set obj = CreateObject("OpScrUtil.TermServer")
	 bOK = obj.GetSessionIDFromWinStation(sWinStationName, lSessionID)
	 if bOK then MsgBox "The Session ID is " & lSessionID

This example shows how to get the Session ID from the SessionName.