Solved

change username using command line

Posted on 2009-04-08
2
941 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
Comment Utility
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
Comment Utility
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
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…

743 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

16 Experts available now in Live!

Get 1:1 Help Now