Using PowerShell to Manage Terminal Services Attributes
PowerShell is quickly becoming the de facto standard scripting method for new Microsoft products. I’ve written in the past about using PowerShell in your environment, which focused mainly on using PowerShell in Citrix environments. PowerShell can also be used to bulk edit Terminal Services attributes as seen in a blog post by Dmitry Sotnikov. Dmitry demonstrates how to get and set Terminal Service attributes using some custom PowerShell cmdlets. Here is an excerpt from the blog post:
Getting TS Attributes
PS C:\> get-qaduser "Dmitry Sotnikov" | format-list Ts*
TsProfilePath : \\server\tsprofiles\DSotnikov
TsHomeDirectory : \\server\tshome\DSotnikov
TsHomeDrive : P:
TsAllowLogon : True
TsRemoteControl : 0
TsMaxDisconnectionTime : 00:00:00
TsMaxConnectionTime : 00:00:00
TsMaxIdleTime : 00:00:00
TsReconnectionAction : 1
TsBrokenConnectionAction : 0
TsConnectClientDrives : True
TsConnectPrinterDrives : True
TsDefaultToMainPrinter : True
TsWorkDirectory : c:\
TsInitialProgram : C:\Program Files\Quest\Initialize.exe
Changing TS Attributes
$u = get-qaduser dsotnikov
$u.TsProfilePath = ‘c:\profile’
$u.CommitChanges()
Technorati : Microsoft, PowerShell, Scripting, Terminal Services, Users
Del.icio.us : Microsoft, PowerShell, Scripting, Terminal Services, Users
Ice Rocket : Microsoft, PowerShell, Scripting, Terminal Services, Users



Jason Conger Blog » Blog Archive » Using PowerShell with Citrix Policies Says:
March 29th, 2008 at 11:03 pm
[…] Using PowerShell to Manage Terminal Services Attributes […]