Returns Terminal Service session configuration information.

This script was tested using Object REXX 2.1.0 for Microsoft Windows, available from IBM.

Object REXX
Edit|Remove
strComputer = "."
objWMIService = .OLEObject~GetObject("winmgmts:\\"||strComputer||"\root\CIMV2")
do objItem over objWMIService~ExecQuery("Select * from Win32_TSSessionSetting")
    say "Active Session Limit:" objItem~ActiveSessionLimit
    say "Broken Connection Action:" objItem~BrokenConnectionAction
    say "Broken Connection Policy:" objItem~BrokenConnectionPolicy
    say "Caption:" objItem~Caption
    say "Description:" objItem~Description
    say "Disconnected Session Limit:" objItem~DisconnectedSessionLimit
    say "Idle Session Limit:" objItem~IdleSessionLimit
    say "Reconnection Policy:" objItem~ReconnectionPolicy
    say "Setting ID:" objItem~SettingID
    say "Terminal Name:" objItem~TerminalName
    say "Time Limit Policy:" objItem~TimeLimitPolicy
end