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

This script was tested using Python 2.2.2-224 for Microsoft Windows, available from ActiveState.

Python
Edit|Remove
import win32com.client
strComputer = "."
objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator")
objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2")
colItems = objSWbemServices.ExecQuery("Select * from Win32_TSLogonSetting")
for objItem in colItems:
    print "Caption: ", objItem.Caption
    print "Client Logon Info Policy: ", objItem.ClientLogonInfoPolicy
    print "Description: ", objItem.Description
    print "Domain: ", objItem.Domain
    print "Password: ", objItem.Password
    print "Prompt For Password: ", objItem.PromptForPassword
    print "Setting ID: ", objItem.SettingID
    print "Terminal Name: ", objItem.TerminalName
    print "Use rName: ", objItem.UserName