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
Technology Tips and News
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
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.
$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