Forum Discussion
How to list azure AD groups for a user using Power shell
- 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.
thanks HidMov for your reply.
I am getting below error, can you please suggest me how to run this command on my powershell ISE.
I changed to az instead of azure in commands. But still few commands not working.
Thanks,
Brahma
HidMov It is working after instaling below module.
Install-Module AzureAD -Repository PSGallery -Force -Scope CurrentUser
thank you so much for your help. It is resolved my issue.
- BrahmaiahAug 25, 2020Brass Contributor
Hi HidMov ,
I am trying to get Azure AD groups Owners list, executing below command but it not working, can you please help on this.
Get-AzureADUser -SearchString "xxxxxx" | Get-AzureADGroupOwner | % {Get-AzureADObjectByObjectId -ObjectId $_.ObjectId | select DisplayName,ObjectType,MailEnabled,SecurityEnabled,ObjectId} | ft
Thanks,
Brahma