Returns information about the Terminal Service logon policies configured on a computer.

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_TSLogonSetting")
    say "Caption:" objItem~Caption
    say "Client Logon Info Policy:" objItem~ClientLogonInfoPolicy
    say "Description:" objItem~Description
    say "Domain:" objItem~Domain
    say "Password:" objItem~Password
    say "Prompt For Password:" objItem~PromptForPassword
    say "Setting ID:" objItem~SettingID
    say "Terminal Name:" objItem~TerminalName
    say "User Name:" objItem~UserName
end