How to export 'Member of' for a user within AD?

I have a request to provide a list of the groups that a particular is a member of
User Properties -> "Member of" Tab

Is there a simple script to pull this information into a text file vs manually typing it out?
Admin_StoogeAsked:
Who is Participating?
 
every1isevil2Commented:
use the dsquery command

http://technet.microsoft.com/en-us/library/cc732952(WS.10).aspx

use "> c:\UsersinOU.TXT" at the end of the command
0
 
Admin_StoogeAuthor Commented:
probably quicker to type it out manually then figure out what the actual command would be
0
 
Chris DentPowerShell DeveloperCommented:
Very easy with Quest's AD CmdLets (http://www.quest.com/powershell/activeroles-server.aspx). I know I've had questions with you before, but I can't remember if you have those / can't have those.

If you can..
Get-QADMemberOf "Some User"

Open in new window

Then if you just wanted group names:
Get-QADMemberOf "Some User" | Select-Object Name

Open in new window

Or if you wanted indirect (nested) membership:
Get-QADMemberOf "Some User" -Indirect | Select-Object Name

Open in new window

There's a similar kind of thing for group membership:
Get-QADGroupMember "Some Group"

Open in new window

Or:
Get-QADGroupMember "Some Group" -Indirect

Open in new window

I find all of those very useful for the quick reporting. Faster than the GUI, and not much brain work required :)

Chris
0
WEBINAR: 10 Easy Ways to Lose a Password

Join us on June 27th at 8 am PDT to learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees. We'll cover the importance of multi-factor authentication and how these solutions can better protect your business!

 
Admin_StoogeAuthor Commented:
Thanks for the tips Chris...I used Hyena to view the groups and performed an export...I went old school...lol
0
 
Chris DentPowerShell DeveloperCommented:
Ahh yeah, I remember that one, it's been years...

As long as you got what you needed :-D

Chris
0
 
every1isevil2Commented:
sorry its dsget and and why download a program when ms provides u the tools to do it
dsget group cn=groupname,ou=if needed,dc=domain,dc=com -membersof > c:\membersof.TXT
0
 
Admin_StoogeAuthor Commented:
hey every1isevil2,

I was in a pickle to get some reports out.  I was not familiar with dsget or I went another direction.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.