0

PowerShell - Export Group Members to CSV

by Jim 16. October 2011 16:52

This script will export a .CSV for each group in an OU.  The CSV will be named the same as the group name.

Get-Group -OrganizationalUnit "Some OU" | ForEach-Object { Get-Group -Identity $_.Name | ForEach { $_.Members } | Get-User | Export-Csv ($_.Name + '.csv') }

Remember this script is designed to run on one line.  Remove the linebreaks.

Tags: , , , , ,

PowerShell

Powered by BlogEngine.NET 2.5.0.6
Original Design by Laptop Geek, Adapted by onesoft