Forum Discussion
Brahmaiah
Aug 21, 2020Brass Contributor
How to list azure AD groups for a user using Power shell
Hi, Could you please help me how to get list of azure AD groups for a user using power shell. Thanks, Brahma
- Aug 21, 2020
Hi Brahmaiah
I use the below:
Get-AzureADUser -SearchString user@domain.com | Get-AzureADUserMembership | % {Get-AzureADObjectByObjectId -ObjectId $_.ObjectId | select DisplayName,ObjectType,MailEnabled,SecurityEnabled,ObjectId} | ft
Where the user@domain.com is the UPN of who you want to search. This will return all groups aside from Dynamic groups.
HidMov
Aug 21, 2020Iron Contributor
Hi Brahmaiah
I use the below:
Get-AzureADUser -SearchString user@domain.com | Get-AzureADUserMembership | % {Get-AzureADObjectByObjectId -ObjectId $_.ObjectId | select DisplayName,ObjectType,MailEnabled,SecurityEnabled,ObjectId} | ft
Where the user@domain.com is the UPN of who you want to search. This will return all groups aside from Dynamic groups.