This is a VBS example straight from the microsoft script cente
Set objUser = GetObject("LDAP://cn=youngrob,ou=r&d,dc=fabrikam,dc=com"
WScript.Echo objUser.Name & " Terminal Services Profile Settings
WScript.Echo "--------------------------------------------------
'*********************************************************************
'* Terminal Services Profile ta
'*********************************************************************
WScript.Echo "Allow Logon: " & objUser.AllowLogo
WScript.Echo "Terminal Services Home Directory: " &
objUser.TerminalServicesHomeDirector
WScript.Echo "Terminal Services Home Drive: " &
objUser.TerminalServicesHomeDriv
WScript.Echo "Terminal Services Profile Path: " &
objUser.TerminalServicesProfilePat
'*********************************************************************
'* Remote control ta
'*********************************************************************
WScript.Echo "Enable Remote Control: " & objUser.EnableRemoteContro
'*********************************************************************
'* Sessions ta
'*********************************************************************
WScript.Echo "Broken Connection Action: " & objUser.BrokenConnectionActio
WScript.Echo "Max Connection Time: " & objUser.MaxConnectionTim
WScript.Echo "Max Disconnection Time: " & objUser.MaxDisconnectionTim
WScript.Echo "Max Idle Time: " & objUser.MaxIdleTim
WScript.Echo "Reconnection Action: " & objUser.ReconnectionActio
'*********************************************************************
'* Environment ta
'*********************************************************************
WScript.Echo "Connect Client Drives At Logon: " &
objUser.ConnectClientDrivesAtLogo
WScript.Echo "Connect Client Printers At Logon: " &
objUser.ConnectClientPrintersAtLogo
WScript.Echo "Default To Main Printer: " &
objUser.DefaultToMainPrinte
WScript.Echo "Terminal Services Initial Program: " &
objUser.TerminalServicesInitialProgra
WScript.Echo "Terminal Services Work Directory: " &
objUser.TerminalServicesWorkDirector