UD09_3A_docs.microsoft.com-Dsadd_Computer
UD09_3A_docs.microsoft.com-Dsadd_Computer
docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-
2012/cc754539(v=ws.11)
08/31/2016
Dsadd is a command-line tool that is built into Windows Server 2008. It is available if you
have the Active Directory Domain Services (AD DS) or Active Directory Lightweight
Directory Services (AD LDS) server role installed. To use dsadd, you must run the dsadd
command from an elevated command prompt. To open an elevated command prompt,
click Start, right-click Command Prompt, and then click Run as administrator.
Syntax
Parameters
Parameter Description
<ComputerDN> Required. Specifies the distinguished name of the computer that you
want to add. If you omit the distinguished name, dsadd takes the
name from standard input (stdin).
-samid Specifies to use the Security Accounts Manager (SAM) name as the
<SAMName> unique SAM account name for this computer, for example,
TESTPC2$. If you do not specify this parameter, then dsadd derives
a SAM account name from the value of the common name attribute
in ComputerDN.
-desc Specifies the description of the computer that you want to add.
<Description>
-loc <Location> Specifies the location of the computer that you want to add.
1/3
Parameter Description
{-s <Server> | - Connects the computer to a server or domain that you specify. By
d <Domain>} default, dsadd connects the computer to the domain controller in the
logon domain.
-u Specifies the user name with which the user logs on to a remote
<UserName> server. By default, -u uses the user name with which the user logged
on. You can use any of the following formats to specify a user name:
{-uc | -uco | - Specifies that dsadd formats output or input data in Unicode. The
uci} following list explains each format.
Remarks
If you do not supply a target object at the command prompt, dsadd obtains the
target object from standard input (stdin). Dsadd can accept stdin from the keyboard,
from a redirected file, or as piped output from another command. To mark the end of
stdin data from the keyboard or in a redirected file, use the end-of-file character
(CTRL+Z).
2/3
If a value that you supply contains spaces, use quotation marks around the text, for
example, "CN=DC 2,OU=Domain Controllers,DC=Contoso,DC=Com".
If you supply multiple values for a parameter, use spaces to separate the values, for
example, a list of distinguished names.
Examples
To create a computer account named client01 in the default Computers container of
northwindtraders.com, type:
3/3