DS Commands – DSGET

Retrieving Information about Objects with DSGET

You can use the dsget command to retrieve information about objects. The dsget command is useful when you want to get a list of group members or user group membership.


Note: The primary difference between dsquery and dsget is that dsquery retrieves mul- tiple objects that meet a given criteria, while dsget retrieves information about a single object.

dsget Command

Comments

Get a list of members for a group.

dsget group DN -members C:\>dsget group “cn=it admins, ou=east, ou=sales, dc=habib, dc=local” -members

Retrieves a list of members of the IT Admins group in the sales\east OU.


List group membership for a user. 

dsget user dn [-memberof -expand]

C:\>dsget user “cn=joe, ou=east, ou=sales, dc=habib, dc=local” -memberof

C:\>dsget user “cn=joe, ou=east, ou=sales, dc=habib, dc=local” -memberof -expand

The -memberof switch shows the direct group membership for a user. The -expand switch includes nested group membership.

For example, consider the Domain Users group, which is a member of the Users group. If a user is added to the Domain Users group, the user is indirectly a member of the Users group.

The -memberof switch shows the Domain Users group but not the Users group, unless the -expand switch is also included.


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s