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.
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 = Get–QADGroup –SearchRoot $OU
by
$fgroups = gc .\groups.txt
$Group = Get-QADGroup $fgroups
Prerequisites: Quest AD Shell
Tech Wizard