I’m trying to use powershell to get a list of global groups in an OU and output the global group name, the members of the group and the domain local groups the global group is a member of, so far I have the output below, but I get the output for the “member of” details<\/p>\n
$OU = ‘OU=Role Groups,OU=USG,OU=Groups,OU=xxx,OU=xxxxxx,DC=xxxxxxx,DC=xxx’ $Groups = Get-ADGroup -Filter * -SearchBase $OU $Data = foreach ($Group in $Groups) { Get-ADGroupMember -Identity $Group -Recursive | Select-Object @{Name=‘Group’;Expression={$Group.Name}}, @{Name=‘Member’;Expression={$_.Name}} } $Data | Export-Csv -Path “C:\\Temp\\FolderPermissions.csv”<\/p>\n
Thanks<\/p>","upvoteCount":2,"answerCount":7,"datePublished":"2021-04-09T12:51:34.000Z","author":{"@type":"Person","name":"acgksxr","url":"https://community.spiceworks.com/u/acgksxr"},"suggestedAnswer":[{"@type":"Answer","text":"
I’m trying to use powershell to get a list of global groups in an OU and output the global group name, the members of the group and the domain local groups the global group is a member of, so far I have the output below, but I get the output for the “member of” details<\/p>\n
$OU = ‘OU=Role Groups,OU=USG,OU=Groups,OU=xxx,OU=xxxxxx,DC=xxxxxxx,DC=xxx’ $Groups = Get-ADGroup -Filter * -SearchBase $OU $Data = foreach ($Group in $Groups) { Get-ADGroupMember -Identity $Group -Recursive | Select-Object @{Name=‘Group’;Expression={$Group.Name}}, @{Name=‘Member’;Expression={$_.Name}} } $Data | Export-Csv -Path “C:\\Temp\\FolderPermissions.csv”<\/p>\n
Thanks<\/p>","upvoteCount":2,"datePublished":"2021-04-09T12:51:34.000Z","url":"https://community.spiceworks.com/t/powershell-to-get-group-members-and-member-of-details/796408/1","author":{"@type":"Person","name":"acgksxr","url":"https://community.spiceworks.com/u/acgksxr"}},{"@type":"Answer","text":"
If you post code, please use the ‘Insert Code’ button. Please and thank you!<\/p>\n