Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


May 2004

Moving Users to Another Server

RSS
Subscribe to Windows IT Pro | See More Active Directory (AD) Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

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.

End of Article



Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Microsoft Kills OneCare, Will Launch Free Security Solution

Microsoft on Tuesday announced that it would retire its $50-a-year security subscription product, Windows Live OneCare, and replace it with a free solution codenamed "Morro." Unlike OneCare, however, Morro will focus only on core anti-malware features and ...

The website is down because someone removed the X-Box

What happens when a manager mistakes a server for a games console. ...

Xbox 360 Overhaul Arrives with New UI, Avatars

Xbox 360 owners who logon to the system's Xbox Live system this morning will receive the most significant functional change yet to the console's user interface, or dashboard. Dubbed the New Xbox Experience, this new front-end features a completely new ...


Active Directory (AD) Whitepapers Sustainable Compliance: How to reconnect compliance, security and business goals

Managing Unix/Linux with Microsoft System Center Operations Manager 2007 Cross Platform Extensions Beta

Addressing the Insider Threat with NetIQ Security and Administration Solutions

Related Events Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

Windows 2003: Active Directory Administration Essentials

Related Active Directory (AD) Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing