Returns information about the Terminal Service client environment settings 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_TSEnvironmentSetting")
    say "Caption:" objItem~Caption
    say "Client WallPaper:" objItem~ClientWallPaper
    say "Description:" objItem~Description
    say "Initial Program Path:" objItem~InitialProgramPath
    say "Initial Program Policy:" objItem~InitialProgramPolicy
    say "Setting ID:" objItem~SettingID
    say "Startin:" objItem~Startin
    say "Terminal Name:" objItem~TerminalName
end