CmdID

CmdID / Commands / netdom

netdom computername

The netdom computername command manages the primary and alternate names for a computer. Windows commands reference

On Windows

Opens CmdID with your command. It is read in your browser and sent nowhere.

Windows

from the Windows commands reference, CC BY 4.0

The netdom computername command manages the primary and alternate names for a computer. This command can safely rename Active Directory (AD) domain controllers (DC) and member servers. It's available if you have the Active Directory Domain Services (AD DS) server role installed. It's also available if you install the AD DS tools that are part of the Remote Server Administration Tools (RSAT). To use netdom computername, you must run the command from an elevated command prompt.

netdom computername machine [/UserO:user] [/PasswordO:[password | *]]
[/UserD:user] [/PasswordD:[password | *]] [/SecurePasswordPrompt]
/Add:<new-alternate-DNS-name> | /Remove:<alternate-DNS-name>
/MakePrimary:<computer-dns-name>
/Enumerate[:{AlternateNames | PrimaryName | AllNames}]
/Verify

To give an alternate name for the DC MyDC in the mydomain.com domain, run the following command

netdom computername mydc.mydomain.com /add:altDCname.mydomain.comIdentify
/addCreates a new alternate name. Windows commands reference

Once the alternate name is added, you can promote it to be the primary name. To rename the domain controller MyDC to altDCname in the mydomain.com domain, use the following command

netdom computername mydc.mydomain.com /makeprimary:altdcname.mydomain.comIdentify
/makeprimaryMakes an existing alternate name into the primary name. Windows commands reference
<machine>Specifies the name of the computer that you want to manage.
/usero:<UserName>Specifies the user account that you want to use for the originating domain.
/passwordo:<Password> \* Specifies the password that you want to use for the originating domain. If you specify *, you're prompted for the password.
/userd:<UserName>Specifies the user account that you want to use for the destination domain.
/passwordd:<Password> \* Specifies the password that you want to use for the destination domain. If you specify *, you're prompted for the password.
/securepasswordpromptOpens a secure credentials popup for entering credentials. This is useful when specifying smartcard credentials. This option is effective only when the password is entered as *.
/add:<NewAltDNSName>Creates a new alternate name. Specify a fully qualified domain name (FQDN), such as comp1.example.com.
/remove:<AltDNSName>Deletes an existing alternate name. Specify an FQDN, such as comp1.example.com.
/makeprimary:<ComputerDNSName>Makes an existing alternate name into the primary name. Specify an FQDN, such as comp1.example.com.
/enumerate:ALTERNATENAMES \PRIMARYNAME\ ALLNAMES Lists the primary name or any alternate names. Values: - ALTERNATENAMES: Lists alternate names only. - PRIMARYNAME: Lists the primary name only. - ALLNAMES: Lists the primary and any alternate names (default).
/verifyChecks if there's a DNS record and a service principal name (SPN) for each computer name.
help \/? Displays help at the command prompt.