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 


February 2001

The Name Game


RSS
Subscribe to Windows IT Pro | See More User Management and Profiles Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!
Main Article    Take Command of Your Management Tasks

Suppose our example user Jennifer Hansen changes her last name to Smith. Her username is jhansen, and her home directory settings point to the H drive on a local file server. She also has a roaming profile on the local file server. Her home and profile folders are both in her name (i.e., Jennifer Hansen). To use Cusrmgr to change her account information (e.g., to change her username to jsmith), use the following command-line syntax:

cusrmgr -u jhansen -m \\pdcserver -r jsmith -f "Jennifer
	Smith" -U \\fileserver\profiles$\jsmith -H H -h
	\\fileserver\jsmith$

The -u switch specifies the current username. The —m switch specifies the machine on which you want to modify the accounts database. (You can omit the —m switch if you want Cusrmgr to default to the local computer.) The -r switch provides the new username. The -f switch replaces the Full Name. The -U switch redefines the profile path, and the -h switch redefines the home directory path.

The switches are case sensitive, and you must put quotation marks around any parameters that contain spaces. Because you're only renaming the account, the user retains all NTFS permissions you assigned; permissions you assigned to Microsoft Exchange Server mailboxes also remain unchanged. Windows NT cares about only the SID associated with the account, and the SID for jhansen doesn't change when you change the username to jsmith.

To wrap Cusrmgr into a batch script with parameters, simply type

changeuser.bat jhansen jsmith Jennifer Smith

Think about the time and effort this tool can save on routine administrative tasks. For a list of Cusrmgr switches and their usage, see the Microsoft Windows 2000 Server Resource Kit's online Help.

End of Article



Reader Comments
I'm in the process of creating scripts to create/disable/delete user accounts and mailboxes. I was very pleased to find the Cusrmgr on the Windows 2000 Resource Kit. It's a great tool, however; everytime I use the tool with the "+/-s RASUser" switch, Cusrmgr generates an application exception. Looking in the logs, the fault is: "FAULT ->77f82b17 f266af repne scasw es:00000078=????" I haven't found any other method of removing "Grant dialin permission to user" from the command-line.

Rick Bridges April 02, 2001


You must log on before posting a comment.

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




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

How can I stop and start services from the command line?

...

Microsoft Touts Xbox 360 'Black Friday' Success

Microsoft this week revealed that its Xbox 360 video game console outsold its Sony PlayStation 3 rival 3-to-1 on "Black Friday," which curiously describes the three day weekend after Thanksgiving, a period that unofficially kicks off the holiday selling ...


Windows OSs Whitepapers Why SaaS is the Right Solution for Log Management

Related Events Introduction to Identity Lifecycle Manager "2"

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs 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