Need to export users from multiple AD groups

HELLO..

I need to export list of users from multiple AD groups ( Around 170) in a single csv file. Please let me know if this can be possible.

Any help is appreciated.

Thanks

September 10th, 2015 11:07am

Hi,

Yes, this is possible.

Prewritten scripts can be found in the repository here:

https://gallery.technet.microsoft.com/scriptcenter

If you'd like to take a crack at this yourself, look at Get-ADGroupMember:

http://ss64.com/ps/get-adgroupmember.html

Let us know if you have any specific questions. If you do, please post your code (using the 'Insert Code Block' button of the input editor) and your errors.

Free Windows Admin Tool Kit Click here and download it now
September 10th, 2015 11:12am


$groups | % { get-ADgroup $_.groupname | get-ADgroupMember } | export-csv $path 


remember to import ActiveDirectory module, and to import-csv file with list of group names with header groupname to var $groups. Try to make it on Your own, in other case You'd never learn how to script / use PS. Hint: to get users from nested groups use -recursive.

Good Luck

September 10th, 2015 4:34pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics