WTS.UserConfig.SetProperty
Top  Previous  Next


Sets / edits terminal server properties.

Notice: unfortunately terminal server operations are very slow by terminal server design. One account / second is not unusual even when SetupBatcher runs directly on the server.

Requirements
In order to run NT4 TS WTS commands from a NT4 workstation you need to copy the following files from the server to the C:\WINNT\system32 of the workstation -

·utildll.dll  
·winsta.dll  
·Wtsapi32.DLL  
·regapi.dll  

Windows 2000, XP workstation or 2003 server: no need to copy anything.

Category
SamAccount

Script section
[Batch], inside Data.Loop..EndLoop statement

WTS.UserConfig.SetProperty SamAccountNameColumnVariable, PropertyName, Value

SamAccountNameColumnVariable
Format: %colX%, X = Column in [Data] section with SamAccountNames  

PropertyName
Name of property to set / edit, see table 1 below  

Value
Value, see table 1 below  

Other parameters
This command is executed on the current machine in the [Machines] section.  

Table 1
PropertyName
Value
InitialProgram
String
WorkingDirectory
String
InheritInitialProgram
Yes | No
AllowLogonTerminalServer
Yes | No
TimeoutSettingsConnections
Minutes, 0 = timer disabled
TimeoutSettingsDisconnections
Minutes, 0 = timer disabled
TimeoutSettingsIdle
Minutes, 0 = timer disabled
DeviceClientDrives
Yes | No
DeviceClientPrinters
Yes | No
DeviceClientDefaultPrinter
Yes | No
BrokenTimeoutSettings
Disconnect | Reset
ReconnectSettings
Any | Previous
ModemCallbackSettings
Disabled | Roving | Fixed   
ModemCallbackPhoneNumber
String
ShadowingSettings
0 = Disabled 1 = Enable input, notify 2 = Enable input, no notify 3 = Enable no input, notify 4 = Enable no input, no notify
TerminalServerProfilePath
String
TerminalServerHomeDir
String

Notice: the directory must also be created with "DOS md". If you set terminal server home directory in "Active Directory Users and Computers", a directory is automatically created, but when you use a script you must take care of things yourself.
TerminalServerHomeDirDrive
String

Notice: if the drive letter is not mapped correctly, try to add a colon after it. Example "WTS.UserConfig.SetProperty col1%, TerminalServerHomeDirDrive,Y:"


Example
Enable "Client devices / Connect client drives at Logon" for accounts listed in [Data] section, column 3

WTS.UserConfig.SetProperty %col3%, DeviceClientDrives, Yes

Full example
WTS example