Dsadd contact

Applies To: Windows Server 2008

Adds a single contact to the directory.

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

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

Syntax

dsadd contact <ContactDN> [-fn <FirstName>] [-mi <Initial>] [-ln <LastName>] [-display <DisplayName>] [-desc <Description>] [-office <Office>] [-tel <PhoneNumber>] [-email <Email>] [-hometel <HomePhoneNumber>] [-pager <PagerNumber>] [-mobile <CellPhoneNumber>] [-fax <FaxNumber>] [-iptel <IPPhoneNumber>] [-title <Title>] [-dept <Department>] [-company <Company>] [{-s <Server> | -d <Domain>}] [-u <UserName>] [-p {<Password> | *}] [-q] [{-uc | -uco | -uci}]

Parameters

Parameter Description

<ContactDN>

Required. Specifies the distinguished name of the contact that you want to add. If you omit the distinguished name, dsadd takes the name from standard input (stdin).

-fn <FirstName>

Specifies the first name of the contact that you want to add.

-mi <Initial>

Specifies the middle initial of the contact that you want to add.

-ln <LastName>

Specifies the last name of the contact that you want to add.

-display <DisplayName>

Specifies the display name of the contact that you want to add.

-desc <Description>

Specifies the description of the contact you that want to add.

-office <Office>

Specifies the office location of the contact that you want to add.

-tel <PhoneNumber>

Specifies the telephone number of the contact that you want to add.

-email <Email>

Specifies the e-mail address of the contact that you want to add.

-hometel <HomePhoneNumber>

Specifies the home telephone number of the contact that you want to add.

-pager <PagerNumber>

Specifies the pager number of the contact that you want to add.

-mobile <CellPhoneNumber>

Specifies the mobile phone number of the contact that you want to add.

-fax <FaxNumber>

Specifies the fax number of the contact that you want to add.

-iptel <IPPhoneNumber>

Specifies the IP phone number of the contact that you want to add.

-title <Title>

Specifies the title of the contact that you want to add.

-dept <Department>

Specifies the department of the contact that you want to add.

-company <Company>

Specifies the company information of the contact you want to add.

{-s <Server> | -d <Domain>}

Connects to a specified remote server or domain. By default, dsadd connects the computer to the domain controller in the logon domain.

-u <UserName>

Specifies the user name with which the user logs on to a remote 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:

  • user name (for example, Linda)

  • domain\user name (for example, widgets\Linda)

  • user principal name (UPN) (for example, Linda@widgets.contoso.com)

-p {<Password> | *}

Specifies to use either a password or an asterisk (*) to log on to a remote server. If you type *, dsadd prompts you for a password.

-q

Suppresses all output to standard output (quiet mode).

{-uc | -uco | -uci}

Specifies that dsadd formats output or input data in Unicode. The following list explains each format.

  • -uc: Specifies a Unicode format for input from or output to a pipe (|).

  • -uco : Specifies a Unicode format for output to a pipe (|) or a file.

  • -uci: Specifies a Unicode format for input from a pipe (|) or a file.

/?

Displays help at the command prompt.

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

  • If the value that you supply contains spaces, use quotation marks around the text, for example, "CN=Mike Danseglio,CN=Users,DC=Contoso,DC=Com".

  • This command only supports a subset of commonly used object class attributes.

Examples

To create a contact named MikeDan in the default Users container of northwindtraders.com, type:

dsadd contact cn=MikeDan,cn=users,dc=northwindtraders,dc=com

Additional references

Command-Line Syntax Key

Dsadd

Dsadd computer

Dsadd group

Dsadd ou

Dsadd user

Dsadd quota