Solved

change username using command line

Posted on 2009-04-08
2
970 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PerfMon Report Time Out 6 43
Unable to Uninstall Visual Studio 2015 7 40
encrypted folder 7 68
Computer hardware speed units 9 60
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

820 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