?
Solved

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

Posted on 2013-11-26
2
Medium Priority
?
432 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
The viewer will learn how to count occurrences of each item in an array.
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)
Suggested Courses

752 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