Subscribe to Windows IT Pro
April 27, 2004 12:00 AM

Moving Users to Another Server

Windows IT Pro
InstantDoc ID #42201
Rating: (0)
Downloads
42201.zip

I recently needed to move several hundred users from one server to another—a daunting task. The Microsoft Management Console (MMC) Active Directory Users and Computers snap-in's Profile tab mapped the users' home folder.

Because all the user directories were in the same folder on the server and the To: path is case sensitive when you map to a directory below the share level (e.g., \\server\share\somedir), I was able to write a simple script to change the home folder's Connect To: attribute. This script, which Listing 3 shows, runs from the directory on the server or from a drive mapped to the appropriate location and requires modifyusers.vbs, which is available from the Microsoft Windows 2000 Professional Resource Kit or Microsoft Windows 2000 Server Resource Kit.

The Dir /ad/b command in the For loop iterates the current working directory (dir) and collects only directories (/ad), in a bare format (/b). I use double quotes around %%i and the Universal Naming Convention (UNC) path because the user IDs contain a space. If the UNC or user ID doesn't contain spaces, the double quotes aren't necessary. The %%i code signifies the name of the current directory, which matches the user ID. (The double percent signs—%%—are necessary because the script is a .cmd file; if you typed the code at a command prompt, you could use just one percent sign.) Output from the .vbs script redirects to the modlog.log file. The double ampersands (&&) in the last line cause the final Echo statement to run if the .vbs script line is successful. Thus, you can watch the script's progress.

Related Content:

ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.