Returns configuration information for all the Terminal Service session directories found on a computer.

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_TSSessionDirectory")
For Each $objItem in $colItems
    ? "Caption:" + $objItem.Caption
    ? "Description:" + $objItem.Description
    ? "SessionDirectoryActive:" + $objItem.SessionDirectoryActive
    ? "SessionDirectoryClusterName:" + $objItem.SessionDirectoryClusterName
    ? "SessionDirectoryExposeServerIP:" + $objItem.SessionDirectoryExposeServerIP
    ? "SessionDirectoryLocation:" + $objItem.SessionDirectoryLocation
    ? "SettingID:" + $objItem.SettingID
Next