次の方法で共有


Netdom add

 

Applies To: Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows 8

Adds a workstation or server account to the domain.

Netdom is a command-line tool that is built into Windows Server 2008 and Windows Server 2008 R2. It is available if you have the Active Directory Domain Services (AD DS) server role installed. It is also available if you install the Active Directory Domain Services Tools that are part of the Remote Server Administration Tools (RSAT). For more information, see How to Administer Microsoft Windows Client and Server Computers Locally and Remotely (https://go.microsoft.com/fwlink/?LinkID=177813).

To use netdom, you must run the netdom command from an elevated command prompt. To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator.

For examples of how to use this command, see Examples.

Syntax

netdom add <Computer> {/d: | /domain:} <Domain> [{/ud: | /userd:}[ <Domain>\]<User> {/pd: | /passwordd:}{ <Password>|*}] [{/s: | /server:} <Server>] [/ou: <OUPath>] [/dc] [/help | /?]

Parameters

Parameter

Description

<Computer>

Specifies the name of the computer that you want to add.

{/d: | /domain:} <Domain>

Specifies the domain in which to create the account. If you do not specify this parameter, then netdom add uses the domain that the current computer belongs to.

{/ud: | /userd:}[ <Domain>\] <User>

Specifies the user account that makes the connection with the domain that you specify in the /d or /domain parameter. If you do not specify this parameter, netdom add uses the current user account.

{/pd: | /passwordd:}{ <Password>|*}

Specifies the password of the user account that you specify in the /ud or /userd parameter. If you specify the value of this parameter as a wildcard character (*), this parameter prompts you for the password.

{/s: | /server:} <Server>

Specifies the name of a domain controller that performs the Add operation.

/ou: <OUPath>

Specifies the organizational unit (OU) under which to create the account. You must use the full RFC 1779 distinguished name of the OU. If you do not specify this parameter, netdom add creates the account under the default OU for computer objects for that domain.

dc

Specifies that a domain controller's machine account is to be created. This makes it possible for the computer accounts for new AD DS domain controllers, and new Windows NT 4.0 backup domain controllers (BDCs) to be pre-created. If installing a new Windows NT 4.0 BDC into an existing Windows 2000 or Windows Server 2003 domain, the computer account must be pre-created. This parameter cannot be used with the /ou parameter.

{/help | /?}

Displays help at the command prompt.

Examples

To add the workstation mywksta to the Windows NT 4.0 domain reskita, type the following command at the command prompt:

netdom add /d:reskita mywksta /ud:mydomain\admin /pd:password

To add the workstation mywksta to the Windows Server 2003 domain devgroup.example.com in the OU Dsys/workstations, type the following command at the command prompt:

netdom add/d:devgroup.example.com mywksta /OU:OU=Dsys,OU=Workstations,DC=contoso,DC=com

Note

If you do not specify the /ou parameter, netdom creates the account in the Computers container.

Additional references

Command-Line Syntax Key

Netdom

Netdom add

Netdom computername

Netdom join

Netdom move

Netdom query

Netdom remove

Netdom movent4bdc

Netdom renamecomputer

Netdom reset

Netdom resetpwd

Netdom trust

Netdom verify