Returns configuration information for all the Terminal Service session directories found 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_TSSessionDirectory")
    say "Caption:" objItem~Caption
    say "Description:" objItem~Description
    say "Session Directory Active:" objItem~SessionDirectoryActive
    say "Session Directory Cluster Name:" objItem~SessionDirectoryClusterName
    say "Session Directory Expose Server IP:" objItem~SessionDirectoryExposeServerIP
    say "Session Directory Location:" objItem~SessionDirectoryLocation
    say "Setting ID:" objItem~SettingID
end