大网数据广告活动
Windows排障命令

Netdom computername

· 52CE 我爱测

Netdom computername is a command-line utility that manages the primary and alternate names for a computer in Windows Server.

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.

Syntax

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

Parameters

Parameter Description
<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.
/securepasswordprompt Opens 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).
/verify Checks if there's a DNS record and a service principal name (SPN) for each computer name.
help | /? Displays help at the command prompt.

Examples

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.com

Before you can make an alternate name the primary name of a computer, the name must exist as an alternate name.

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.com

When you rename a member server, the process is similar. Use an existing alternate name as the new primary name.

See also

Command-Line Syntax Key

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Server documentation
适用范围
Windows Server · Source date 06/09/2025
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。