A quick and nice script to get all groups and their member users exported in PowerShell… you might need that for multiple reasons, and getting them quick is a nice thing…
Today I needed that for a customer who asked for it because he was cleaning his 1000 users active directory, and lucky me, the force of PowerShell can just do anything!
Script:
1 2 3 4 5 6 |
$groups = get-adgroup -filter * foreach ($group in $groups) { echo "Group: $group - Member list:" get-adgroupmember -identity "$group" | select Name, SamAccountName | ft -au } |
The above will just display the output on the screen, so in order to have it in a file, … Read the rest “PS: Get all active directory groups with their member users”