[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 543
  • Last Modified:

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?
0
Admin_Stooge
Asked:
Admin_Stooge
  • 3
  • 2
  • 2
2 Solutions
 
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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
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

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now