Microsoft – Active Directory – Find user’s group

Introduction

One can determine the groups a user is a member of by using the tools bundled with MS Windows 2003 Administrative Tools.

Command

Syntax

dsquery user -samid username | dsget user -memberof

Sample

dsquery user -samid dadeniji | dsget user -memberof

Output


"CN=milano INC USERS,OU=SmartDL,OU=Financialsys,OU=Groups,OU=USA,DC=milano,DC=com"
"CN=VPN Users - Class A,OU=Application Groups,OU=Groups,OU=ISO,DC=milano,DC=com"
"CN=Prod DBA,OU=Groups,OU=USA,DC=milano,DC=com"
"CN=Internet_Users,OU=Groups,OU=ISO,DC=milano,DC=com"
"CN=Domain Users,CN=Users,DC=milano,DC=com"

 

References

  1. Misc – dsquery vs Powershell
    http://marcusoh.blogspot.com/2008/02/misc-dsquery-vs-powershell-2.html

Leave a Reply

Please log in using one of these methods to post your comment:

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