Get-ADPrincipalGroupMembership Username | Select Name | echo >> c:\groups.txt
Where Username
is the name of the user you’re querying. Also the | echo >> c:\groups.txt will export this to a txt file. So remove it if you want it on screen.
In this short tutorial we wil dive in to advanced stuff with active directory exports. We will be exporting Active Directory users Member of list. Or to what Groups the user belongs to. Also we will export the members of the Security group.
If you want to get a user’s group memberships, run this is PowerShell:
Get-ADPrincipalGroupMembership Username | Select Name | echo >> c:\groups.txt
Where Username
is the name of the user you’re querying. Also the | echo >> c:\groups.txt will export this to a txt file. So remove it if you want it on screen.
If you want to get a user’s group memberships, run this is PowerShell:
Get-ADGroupMember Username | Select Name | echo >> c:\groups.txt
And again Username
is the name of the user you’re querying.
You can find all the commands on the docs.microsoft.com/en-us/powershell/