Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remotely Rename Windows 10 System

Status
Not open for further replies.

DCLUser

Technical User
Feb 17, 2011
26
CA
I need a way to remotely rename a Windows 10 computer after it has been freshly imaged. Windows is assigning a default name (ie: WINDOWS-34JDR8E) and I'd like to be able to run a VBScript that asks for the current name of the system (ie: WINDOWS-34JDR8E), asks for the new name (ie: NEW-NAME), and successfully renames the computer without having to manually log into the computer and manually rename it.

I searched around a lot and the only thing I could find that indicated it worked in Windows 10 was a batch file used to run a WMIC command (ie: wmic /node:"oldname" computersystem where caption="oldname" call rename name="newname" username="administrator" password="adminpassword"). The command returns a value of 0 (zero) when successful but more often then not returns 1312, which basically means it didn't work.

Has anyone got any magic up their sleeves that will work to remotely rename a Windows 10 computer on a domain?
 
This can be done with WinRM and PowerShell.



Just my $.02

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
gbaughma: What is the syntax of the command?
 
You have to make a powershell connection to the computer to be renamed, then it's:

Rename-Computer -ComputerName oldname -NewName newname -SomainCredential domain\login -Force -Restart



Just my $.02

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
Greg:
If there is a PowerShell solution to a vbscript question, please direct people to the PowerShell forum and post the solution there.
forum1619
 
Oops.... my bad. Just responded to the question, and wasn't paying attention to the forum.



Just my $.02

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top