Dsget

Description:  This tool's commands display the selected properties of a specific object in the directory. The dsget commands:

dsget computer - displays properties of computers in the directory.
dsget contact - displays properties of contacts in the directory.
dsget subnet - displays properties of subnets in the directory.
dsget group - displays properties of groups in the directory.
dsget ou - displays properties of ou's in the directory.
dsget server - displays properties of servers in the directory.
dsget site - displays properties of sites in the directory.
dsget user - displays properties of users in the directory.
dsget quota - displays properties of quotas in the directory.
dsget partition - displays properties of partitions in the directory.

To display an arbitrary set of attributes of any given object in the directory use the dsquery * command (see examples below).

For help on a specific command, type "dsget <ObjectType> /?" where <ObjectType> is one of the supported object types shown above.
For example, dsget ou /?.

Remarks:
The dsget commands help you to view the properties of a specific object in the directory: the input to dsget is an object and the output is a list of properties for that object. To find all objects that meet a given search criterion, use the dsquery commands (dsquery /?).

The dsget commands support piping of input to allow you to pipe results from the dsquery commands as input to the dsget commands and display detailed information on the objects found by the dsquery commands.

Commas that are not used as separators in distinguished names must be escaped with the backslash ("\") character (for example, "CN=Company\, Inc.,CN=Users,DC=microsoft,DC=com"). Backslashes used in distinguished names must be escaped with a backslash (for example, "CN=Sales\\ Latin America,OU=Distribution Lists,DC=microsoft, DC=com").

Examples:
To find all users with names starting with "John" and display their office numbers:

        dsquery user -name John* | dsget user -office

To display the sAMAccountName, userPrincipalName and department attributes of the object whose DN is ou=Test,dc=microsoft,dc=com:

        dsquery * ou=Test,dc=microsoft,dc=com -scope base -attr
        sAMAccountName userPrincipalName department

To read all attributes of any object use the dsquery * command. For example, to read all attributes of the object whose DN is ou=Test,dc=microsoft,dc=com:

        dsquery * ou=Test,dc=microsoft,dc=com -scope base -attr *

Directory Service command-line tools help:
dsadd /? - help for adding objects.
dsget /? - help for displaying objects.
dsmod /? - help for modifying objects.
dsmove /? - help for moving objects.
dsquery /? - help for finding objects matching search criteria.
dsrm /? - help for deleting objects.