ppmchgo
asked on
Nested list of group membership for users
I need to list each group (recursively) that an individual AD user is a member of and have the data saved in a CSV file.
Ideally, it will have five columns; username, parent group, sub groups, group type, group scope.
I have found quite a few scripts that people have written, but they either give me the data onscreen and I can't figure out how to export to csv or they export to csv fine, but don't give me the data I need.
Any help?
Ideally, it will have five columns; username, parent group, sub groups, group type, group scope.
I have found quite a few scripts that people have written, but they either give me the data onscreen and I can't figure out how to export to csv or they export to csv fine, but don't give me the data I need.
Any help?
This is pretty easy. If you are only looking to find Groups where a specific user is part of use the following one-liner below...
Thats it.
Will.
Get-ADPrincipalGroupMembership -Identity user1 | Select Name, GroupScope, GroupCategory | Export-csv "c:\groups.csv" -nti
Thats it.
Will.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was not able to solve the problem I was having. I ended up coming up with a different solution that satisfied what I was looking for.
Dan