Solved

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

Posted on 2013-11-25
2
502 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

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

778 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