HOWTO: Remote Rename a Computer in a Domain Network on Windows

To rename a computer or a member server in a domain network, you must use the netdom system utility, which comes in the Windows Server editions. This utility comes with Active Directory Domain Services Tools, which is installed on simple PCs for remote administration of servers running Windows Server.

Rename a Computer in a Domain Remotely

To rename computers in a domain remotely, you need:

  • Renamed computer must be turned on.
  • On the local computer (if you will rename computers from your workstation, and not from the server) the netdom.exe program must be installed.
  • If you are going to rename computers from the CSV file then you need PowerShell.

Now you can proceed to rename the computer:

  • Go to the folder with the utility netdom.exe

    Step to Remote Rename a Computer is to go to folder with netdom


  • Run the command:

    netdom renamecomputer old_computer_name / newname: new_computer_name / userd: domain_name \ admin_name / passwordd: domain_admin_user_password / usero: local_administrator / passwordo: local_local_administer_password / reboot: time_in_seconds_to_automatic_reloading


    Step to Remote Rename a Computer is to run netdom command

If you need to rename computers according to the list from the CSV file, then:

  • Create the rename.csv file in the c: \ temp folder

    Create file rename csv

  • Write to this file a list of computers in a text editor without spaces between commas, in the format:

    OldName,NewName
    Machine1,Computer1
    Machine2,Computer2
    Old_computer_name, new_computer_name


  • Create the file rename.ps1 with the following contents:

    $csvfile = "C:\temp\rename.csv"
    Import-Csv $csvfile | foreach {
    $oldName = $_.OldName;
    $newName = $_.NewName;
    Write-Host "Renaming computer from: $oldName to: $newName"
    netdom renamecomputer $ oldName / newName: $ newName / userd: domain_name \ administrator_name / passwordd: domain_administrator_password / usero: local_administrator / passwordo: local_administrator_password_old_computer / reboot: time_in_seconds_to_auto_reboot
    }

    Then run this script.

    Detailed Syntax of Command netdom

    Renaming is done under a domain account.

    Command syntax:

    netdom renamecomputer computer /newname: new_computer_name /userd:[ domain_name \] administrator_name [/passwordd:[ password | *]] /usero:[ domain \] local_administrator> [/passwordo:[ password | *]] [/reboot[: time ]] [{/help | /?}]

    Sometimes it is enough to enter:

    netdom renamecomputer computer / newname: new_ computer_name / userd: [ domain_name \] administrator_name / passwordd: [ password ]

    More details:

    • renamecomputer - key for renaming;
    • computer - computer before renaming;
    • / newname: new_computer_name - desired computer name after renaming (no quotes are needed!);
    • / userd: domain_name \ administrator_name - here you must put the name of the domain administrator;
    • / passwordd: * - leave exactly as written, in fact, this key determines the wildcard character when entering the password;
    • / usero: local_administrator - here you must enter the username of the local administrator (or repeat the domain entry, if he has administrator rights on the local machine);
    • / passwordo: * - local administrator password.

    Also consider using Action1 to rename a computer in a domain network if:

    • - You need to perform this action on multiple (hundreds or even thousands) computers simultaneously.
    • - Some of your endpoints are laptops not connected to corporate network at all times.

    Action1 is a cloud-based platform for software deployment, software/hardware inventory, patch management, endpoint configuration and more. It is free with basic functionality.


    Other Relevant HOWTOs: