Solved

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

Posted on 2013-11-26
2
426 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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Suggested Solutions

Synchronize a new Active Directory domain with an existing Office 365 tenant
A procedure for exporting installed hotfix details of remote computers using powershell
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now