Solved

script to query AD for all Global Security Groups that contain Nested Groups and it's name

Posted on 2013-11-26
2
428 Views
Last Modified: 2013-11-27
I need to find all names of nested groups in every global security group.
0
Comment
Question by:scfcu
2 Comments
 
LVL 3

Expert Comment

by:RKnebel512
ID: 39678348
So, I don't have access to an active directory server at the moment to test this out, but I thought I would pass on the information that I found.  This site seems to be explaining a similar thing to what you want.  

http://bradkingsley.com/using-powershell-to-list-group-membership-from-active-directory-ad/

The only difference is that the script on this site will pull all members of a group and not just the nested groups.  

So it will take a bit of tweaking on the script to get exactly what you want.  But it might be a start.
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39680041
Try...
Import-Module Activedirectory
Get-ADGroup -Filter * -Properties Members | 
  ?{$_.GroupScope -eq "Global" `
    -and $_.GroupCategory -eq "Security"} | % {
      $Group = $_.Name
       $_.Members | Get-ADObject |
     ? {$_.objectClass -eq "group"} | 
  Select @{N="Group";E={$Group}},@{N="Member";E={$_.Name}}
} | Export-Csv C:\temp\report.csv -nti

Open in new window

0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will help you understand what HashTables are and how to use them in PowerShell.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question