Solved

change username using command line

Posted on 2009-04-08
2
950 Views
Last Modified: 2013-12-28
Does any know how to change the username on a computer using comming line, I am trying to change the Guest username one 150 PC.
0
Comment
Question by:woodall01
2 Comments
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 250 total points
ID: 24098115
There is no "net user rename" command.  but I found this here on EE.

http://www.experts-exchange.com/Programming/Misc/Q_22031500.html

It points to the following VBScript code which appears to do what you desire.
' This code renames a local account.

' ---------------------------------------------------------------

' From the book "Windows Server Cookbook" by Robbie Allen

' ISBN: 0-596-00633-0

' ---------------------------------------------------------------
 

' ------ SCRIPT CONFIGURATION ------

strComputer = "<ServerName>"   ' e.g. srv01

strOldName = "<OldName>"       ' e.g. Guest

strNewName = "<NewName>"       ' e.g. RallencorpGuest

' ------ END CONFIGURATION ---------

set objComp = GetObject("WinNT://" & strComputer)

set objUser = GetObject("WinNT://" & strComputer & "/" & strOldName & ",user")

set objNewUser = objComp.MoveHere(objUser.ADsPath, strNewName)

WScript.Echo "Successfully renamed account"

Open in new window

0
 
LVL 5

Expert Comment

by:wpathan
ID: 24098190
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now