Returns Terminal Service session configuration information.

This script was tested using Kixtart 2001 (412) for Microsoft Windows, available from Kixtart.org.

Kixtart
Edit|Remove
$strComputer = "."
$objWMIService = GetObject("winmgmts:\\"+ $strComputer + "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_TSSessionSetting")
For Each $objItem in $colItems
    ? "Active Session Limit:" + $objItem.ActiveSessionLimit
    ? "Broken Connection Action:" + $objItem.BrokenConnectionAction
    ? "Broken Connection Policy:" + $objItem.BrokenConnectionPolicy
    ? "Caption:" + $objItem.Caption
    ? "Description:" + $objItem.Description
    ? "Disconnected Session Limit:" + $objItem.DisconnectedSessionLimit
    ? "Idle Session Limit:" + $objItem.IdleSessionLimit
    ? "Reconnection Policy:" + $objItem.ReconnectionPolicy
    ? "Setting ID:" + $objItem.SettingID
    ? "Terminal Name:" + $objItem.TerminalName
    ? "Time Limit Policy:" + $objItem.TimeLimitPolicy
Next