Export AD group members – CSV format

As Technet Gallery is retiring so moving the code to Git Hub. (click below github download link for this script)

Export AD group members – CSV format

 

Hi Readers,

One of my friend who is a SQL DBA contacted me that he needs to export group mebers from all AD groups

and than import it via SSIS package, he needed CSV in below format.

Capture

Here is the Script code that you can just extract from above zip file, just change the OU

$OU = ‘OU=TestOU,OU=Groups,DC=labtest,DC=com’ #define OU

You can also get the groups from text file , replace

$OU = ‘OU=TestOU,OU=Groups,DC=labtest,DC=com’ #define OU 

$Group = GetQADGroup SearchRoot $OU 

by

$fgroups = gc .\groups.txt
$Group = Get-QADGroup $fgroups

 

Prerequisites: Quest AD Shell

Tech Wizard

https://techwizard.cloud

https://syscloudpro.com/

 

Advertisement

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 )

Facebook photo

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

Connecting to %s