[THIN] Re: NT 4 global profile change

  • From: "Jeff Durbin" <techlists@xxxxxxxxxxxxx>
  • To: <thin@xxxxxxxxxxxxx>
  • Date: Thu, 13 May 2004 07:29:13 +1200

I posted this a few weeks ago. TSCMD can query values as well as set them,
so it can be used initially to generate a list of current users and their
settings which could then be used in the event of a problem to revert to
those original settings:

<----------------- SNIP ------------------------>

  There are a few ways to do it. You can't directly get to the TS properties
via VBScript in NT4 or 2000, so you have to use the Windows API. That
requires a COM object created in anotheer language, like Visual Basic, that
can be called from the scripting language. Thomas Eck has written about

Practical Usage of ADSI: Using COM Objects to Manage WTS Profile Paths, Part

  This method is preferred if you want to apply some logic to the process,
like changing properties for users in a particular OU, or only users that
belong to certain groups. 
  Because you want to make the same change to all users, there's an easier
way to do it. There's a program you can download from The Thin at:


  It's called TSCMD, and allows you to set the TS properties from a command
line. For example, to set the drive, you'd go:

Tscmd server username TerminalServerHomeDirDrive H:
Tscmd server username TerminalServerHomeDir \\server\home\username

  If you use the 2nd method (TSCMD), your next question will be how to call
the program for each user. You'll need a text file that has all your
usernames listed in it, each one on it's own line, like this:


  Put TSCMD and the text file in the same directory. Let's say the text file
is called userlist.txt. Open a command prompt and change to that folder.
Issue these commands:

For /f %x in (userlist.txt) do tscmd server %x TerminalServerHomeDirDrive H:
For /f %x in (userlist.txt) do tscmd server %x TerminalServerHomeDir

  The For-in-do loop reads userlist.txt, and issues the commands after the
'do' part for each line in the text file. During each execution, the %x
variable is set to the username.


Jeff Durbin

 <----------------- SNIP ------------------------>

> -----Original Message-----
> From: thin-bounce@xxxxxxxxxxxxx 
> [mailto:thin-bounce@xxxxxxxxxxxxx] On Behalf Of Jim Kenzig 
> http://thin.net
> Sent: Thursday, 13 May 2004 3:11 a.m.
> To: thin@xxxxxxxxxxxxx
> Subject: [THIN] Re: NT 4 global profile change
> That object is at:
> http://cwashington.netreach.net/main/tools/default.asp?topic=n-z
> JK
> -----Original Message-----
> From: thin-bounce@xxxxxxxxxxxxx [mailto:thin-bounce@xxxxxxxxxxxxx]On
> Behalf Of Chris Lynch
> Sent: Wednesday, May 12, 2004 10:56 AM
> To: thin@xxxxxxxxxxxxx
> Subject: [THIN] Re: NT 4 global profile change
> Or just look for WTS_ADMIN.DLL on Google.  That will give you 
> the ability to create a script to mass change all of your 
> users.  If you need assistance with creating the script, just 
> let me know off list.
> Chris

This Week's Sponsor - Tarantella Secure Global Desktop
Tarantella Secure Global Desktop Terminal Server Edition
Free Terminal Service Edition software with 2 years maintenance.
Useful Thin Client Computing Links are available at:
For Archives, to Unsubscribe, Subscribe or 
set Digest or Vacation mode use the below link:

Other related posts: