Solved

Script to query all users in the domain and find out which Global Groups they belong to

Posted on 2013-11-25
2
497 Views
Last Modified: 2013-11-26
Script to query all users in the domain and find out which Global Groups they belong to or query all users and find out if the belong to any of the groups in a specific OU.
0
Comment
Question by:scfcu
2 Comments
 
LVL 7

Expert Comment

by:hirenvmajithiya
ID: 39676625
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39676833
If you have windows 2008 R2 Domain controller or above then you can try...
Import-Module Activedirectory
Get-ADUser -Filter * -Properties DisplayName,memberof | % {
 $Name = $_.DisplayName
 $_.memberof | Get-ADGroup | ?{$_.GroupScope -eq "Global"} | Select @{N="User";E={$Name}},Name
} | Export-Csv C:\temp\report.csv -nti

Open in new window

0

Join & Write a Comment

Resolve DNS query failed errors for Exchange
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

758 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

17 Experts available now in Live!

Get 1:1 Help Now