This how to will show you how to rename domain computers avoiding the hassle of walking to every domain computers to rename them.

I’ll make it quick and simple to you (as most of you expected) :
Prerequisite :
If you’re using Windows XP, download Windows XP Support Tools from here

  • Start > Run > type in “notepad” (without the quotes) > Enter
  • Copy the following vbs script code and paste it to your just-opened notepad :

    'Author :
    'On Error Resume Next
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    set WSHShell = wscript.createObject("")
    Dim sNewName
    Dim sOldName
    Dim nTotalComputer
    Dim i
    Dim sUserName
    Dim sPassword
    sUserName = InputBox("Insert Username with Administrator rights" & vbCr & vbLf & "Username must be in DOMAIN\username format","")
    sPassword = InputBox("Insert Password for username : " & sUserName,"")
    nTotalComputer = InputBox("Number of computers to be renamed","")
    i = 1
    for i = i to nTotalComputer
    sOldName = InputBox("Old Computer Name" & vbCr & vbLf & "Computer # " & i & " from " & nTotalComputer,"")
    sNewName = InputBox("New Computer Name" & vbCr & vbLf & "Old Computer Name : " & sOldName,"")
    Call WSHShell.Run("netdom renamecomputer " & sOldName & " /newname:" & sNewName & " /userd:" & sUserName & " /passwordd:" & sPassword & " /usero:" & sUserName & " /passwordo:" & sPassword & " /force ")
  • Save the file as renamecomputers.vbs (or anything you like but keep the .vbs extension)

That’s it … go give it a try … (still find a way to import and use list of computers from txt or csv file)

3 Replies to “how to remotely rename domain computers”

    1. Hi Fabio, thanks for your confirmation.
      Did you do anything else (install some system tools, etc) before run the script or just directly run the script from win 7 ?

  1. Actually I managed to import list and do this automatically. All you need to do is make a spreadsheet with two column, the first will be for old computer name, the second for new computer name.

    The script will automatically rename the computers all at once.
    BUT … I forgot where did I save the script … LOL
    Will try to find it and post the update here

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.