How to export all members of all groups in a certain OU with PowerShell

This is the script that cost me near 2h of googling on the Internet.
What does it do?
It exports a list of users with custom given attributes, members of groups in an OU you specify.
This script plus some basic Excel processing helped me to find out how many Citrix users we have in all groups we use.

Get-QADGroup -SizeLimit 0 -SearchRoot 'ww.contoso.com/OU/AnotherOU/Groups/Global/Citrix' | Get-QADGroupMember -SizeLimit 0 | select NTAccountName,AccountIsDisabled,Name | Export-Csv C:\TEMP\all_my_groups.csv

Advertisement
About

Victor an End User Computing Consultant. You find him most of the time on Twitter (@01004753) but also on LinkedIn evangelizing new technologies and processes that can change in good, the world we live in. Victor has expertise in Server & Client Virtualization, Client Management, GPU Virtualization, HyperConvergence and Enterprise Security

Posted in HowTo, PowerShell

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow Victor Homocea on WordPress.com
My Gravatar

CormacHogan.com

Storage, Virtualization, Container Orchestration

Marius Sandbu

msandbu.org

Trafictube.ro

cu camera pe bord

Ingmar Verheij

About Citrix, Remote Desktop, Performance, Workspace, Monitoring and more...

Carl Stalhood

Filling gaps in EUC vendor documentation

Stéphane Thirion

Don't Follow the Trend

Victor Homocea

blog.ogs.ro

Ray Heffer

Enterprise Technologies

Elvis Apostol

Calatorind prin lumi indepartate, pictez in cuvinte, lacrimi de culori.

%d bloggers like this: