Sponsored Links

Login Form






Lost Password?

Syndicate

Home arrow Knowledgebase arrow Windows arrow Remotely Rename Domain PC
Remotely Rename Domain PC PDF Print E-mail
User Rating: / 10
PoorBest 
Written by Cheyenne Harden   
A task as simple as renaming a Domain PC remotely would seem like a simple task. For whatever reason, there is really no good way of doing this. After searching through various scripts to do this job, I finally found a pretty good way of doing this. All it requires is a little vb script and netdom.exe from the Windows Support Tools.

First off, you will need to download the Windows XP Support tools from here

Install the support tools to the default path.

 After it is installed, we are going to create a vb script.
Open Notepad and copy and paste the following text into Notepad

COPY EVERYTHING BELOW THIS LINE
---------------------------------------------------------------------------------------
'On Error Resume Next

'open the file system object
Set oFSO = CreateObject("Scripting.FileSystemObject")
set WSHShell = wscript.createObject("wscript.shell")

Dim sNewCname     'Variable to hold Computer Name you enter in the inputbox
Dim sOldCname        'computers current name

'First param is message text, second is message title
sOldCname = InputBox("Enter computers current name","Windows 2k3 Netdom Rename Script")
sNewCname = InputBox("Enter computers new name","Windows 2k3 Netdom Rename Script")

Call WSHShell.Run("cmd.exe /K netdom renamecomputer " & sOldCname & " /newname:" & sNewCname & " /userd:DOMAIN\ADMINISTRATOR /passwordd:PASSWORD /usero:DOMAIN\ADMINISTRATOR /passwordo:PASSWORD /force ")

-----------------------------------------------------------------------------------------
COPY EVERYTHING ABOVE THIS LINE

After you copy and paste the text into notepad, replace the capitalized text on the last line to fit your network. For the password fields, if you do not want to store passwords in clear text in the vbs file, replace PASSWORD with *. Save the file as Remotely_Change_Computername.vbs and save it in a location you will remember.

When you run the script it will prompt you for the current computername, type in the current computer name and press enter.
It will then ask you for the name you want to change the computername to, type in what you want to change it to and press enter.
If you stored the passwords in the vbs file, it will automatically rename the computer, if you put the * in the place of the password in the vbs file it will prompt you for the passwords to the usernames you entered. After completing these steps, the remote machine will be renamed.

Note: You can just run the netdom.exe file from the command line using netdom.exe renamecomputer OldName /NewName /userd:DOMAIN\ADMINISTRATOR /passwordd:PASSWORD /usero:DOMAIN\ADMINISTRATOR /passwordo:PASSWORD /force
I just like to have a few click access without running to a command prompt and remembe which switches to add to complete my task.

NOTE: THIS INFORMATION IS PROVIDED "AS IS" WITH NO WARRANTIES EXPRESSED OR IMPLIED.

 

Comments
Add NewSearch
ballycotton   | Registered | 08-05-2007 09:27:03
Cant the oldname be got automatically through the cmd prompt? Instead of using what you have done below?

sOldCname = InputBox("Enter computers current name","Windows 2k3 Netdom Rename Script"
ceharden - Reply   | Author | 23-05-2007 09:11:30
This script is run locally on an admin computer to change the name of a remote machine. This is why I enter the name of a "remote" computer to change its name.
Nnyan - automate?   | Registered | 05-09-2007 13:13:00
Anyway that we can get this to work from a csv (ex: oldname:newname) file without the prompts? It would be nice if it would then dump the success/failures into another file for review.

Thanks!
aijiaen - wow gold     | 125.70.58.xxx | 13-11-2008 23:36:06
Aaaaah, that wow gold classic bit of comedy always cheers up everyone in my raid! Yahtzee! This post says it all. Fight your raid mobs from the back, nearly wow gold all of them are not friendly to DPSers wow gold in the front. As a dagger spec rogue, I could probably describe a boss's rear better wow gold than I could their front, either that or their wow gold giant feet.Thanks for all the info! When I am instancing, should I try to stand behind mobs when DPSing? Or is this really wow gold only important in the late game?lmao, this is so true and made me bash my face in my keyboard many of times on my druid.If you're DPSing wow gold and a tank has the mob's aggro, you should be behind it as a melee DPS class.Unless there's something special like a k...
aijiaen - wow gold     | 125.70.58.xxx | 13-11-2008 23:36:19
This idea wow power leveling Kerrigan had against heavy units came after she witnessed Terran wow power leveling Armor Annihilators tear through some Ultalisks very easily. This new member of the swarm was engineered directly towards eliminating heavy units. The only drawback is to the Protoss with Twilight Archons. However since the Infiltratorlisk jumps inside buy wow gold and tears a hole then destroys the heavy cheap wow gold unit would mean that the Infiltratorlisk could be used against Immortals, evening things up with wow power leveling the Armor Annihilator not being able to attack Immortals but could attack Twilight Archons well.thats my Zerg unit buy wow gold for my heavy unit counter idea, I hope you cheap wow gold enjo...
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
 
Security Image
Please input the anti-spam code that you can read in the image.

Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved.

 
Tag it:
Delicious
Furl it!
Spurl
digg
YahooMyWeb
< Prev   Next >
 

Google Search

Google