Dsget contact
Applies To: Windows Server 2008, Windows Server 2012, Windows 8
Displays the properties of a contact in the directory.
Dsget 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 dsget, you must run the dsget 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
dsget contact <ContactDN> [-dn] [-fn] [-mi] [-ln] [-display] [-desc] [-office] [-tel] [-email] [-hometel] [-pager] [-mobile] [-fax] [-iptel] [-title] [-dept] [-company] [{-s <Server> | -d <Domain>}] [-u <UserName>] [-p {<Password> | *}] [-c] [-q] [-l] [{-uc | -uco | -uci}]
Parameters
Parameter |
Description |
---|---|
<ContactDN> |
Required. Specifies the distinguished names of the contact objects that you want to view. If this parameter is omitted, its value is taken from standard input (stdin) to support piping of output from another command to input of this command. |
-dn |
Displays the distinguished names of the contacts. |
-fn |
Displays the first names of the contacts. |
-mi |
Displays the middle initials of the contacts. |
-ln |
Displays the last names of the contacts. |
-display |
Displays the display names of the contacts. |
-desc |
Displays the descriptions of the contacts. |
-office |
Displays the office locations of the contacts. |
-tel |
Displays the telephone numbers of the contacts. |
Displays the e-mail addresses of the contacts. |
|
-hometel |
Displays the home telephone numbers of the contacts. |
-pager |
Displays the pager numbers of the contacts. |
-mobile |
Displays the mobile phone numbers of the contacts. |
-fax |
Displays the fax numbers of the contacts. |
-iptel |
Displays the IP phone number of the contact. |
-title |
Displays the titles of the contacts. |
-dept |
Displays the departments of the contacts. |
-company |
Displays the company information of the contacts. |
{-s <Server>| -d <Domain>} |
Connects to a remote server or domain that you specify. By default, dsget 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:
|
-p {<Password> | *} |
Specifies to use either a password or an asterisk (*) to log on to a remote server. If you type *, dsget prompts you for a password. |
-c |
Reports errors, but continues with the next object in the argument list when you specify multiple target objects (continuous operation mode). If you do not specify this parameter, dsget contact exits when the first error occurs. |
-q |
Suppresses all output to standard output (quiet mode). |
-l |
Displays entries in a list. By default, dsget displays entries in a table. |
{-uc| -uco| -uci} |
Specifies that dsget formats output or input data in Unicode. The following list explains each format.
|
/? |
Displays help at the command prompt. |
Remarks
If you do not supply a target object at the command prompt, dsget obtains the target object from standard input (stdin). Dsget 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).
Use dsget to view the properties of a specific object in the directory.
As a result of dsquery searches, you can pipe returned objects to dsget and obtain object properties.
If a value that you supply contains spaces, use quotation marks around the text, for example, "CN=Mike Danseglio,OU=Contacts,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 display the description and phone numbers for contacts Mike Danseglio and Don Funk, type:
dsget contact "CN=Mike Danseglio,OU=Contacts,DC=Contoso,DC=Com" "CN=Don Funk,OU=Contacts,DC=Contoso,DC=Com" -desc -tel