QPeiran
QPeiran

Reputation: 1505

How to check which Azure Active Directory Groups I am currently in?

It is possible to return a list that shows all the Azure AD groups the current account is belonging to?

Both using Azure portal web UI and PowerShell are appreciated!

Upvotes: 6

Views: 30576

Answers (3)

ormu5
ormu5

Reputation: 145

I was able to view my group membership in the portal by:

  • once logged in, click on profile in upper-right
  • click the elipsis, then 'My permissions'
  • select the subscription for which you want to view membership
  • you should see an entry for each group you are a member, and a brief description of the degree of access

Upvotes: 7

scottwtang
scottwtang

Reputation: 2040

Here's a few different ways other than using the Portal

Azure AD PowerShell Module

Get-AzureADUserMembership

$user = "[email protected]"

Connect-AzureAD
Get-AzureADUserMembership -ObjectId $user | Select DisplayName, ObjectId

Microsoft Graph PowerShell Module

Get-MgUserMemberOf

$user = "[email protected]"

Connect-MgGraph
(Get-MgUserMemberOf -UserId $user).AdditionalProperties | Where-Object {$_."@odata.type" -ne "#microsoft.graph.directoryRole"} | ForEach-Object {$_.displayName}

Microsoft Graph API HTTP Request through PowerShell

List memberOf

$user = "[email protected]"

$params = @{
    Headers = @{ Authorization = "Bearer $access_token" }
    Uri     = "https://graph.microsoft.com/v1.0/users/$user/memberOf"
    Method  = "GET"
}

$result = Invoke-RestMethod @params
$result.Value | Where-Object {$_."@odata.type" -ne "#microsoft.graph.directoryRole"} | Select DisplayName, Id

Microsoft Graph Explorer

GET https://graph.microsoft.com/v1.0/users/[email protected]/memberOf

Upvotes: 3

Gaurav Mantri
Gaurav Mantri

Reputation: 136336

For Portal, simply click on the user for which you want to find this detail and then click on "Groups" button.

enter image description here

If you want to use PowerShell, the Cmdlet you would want to use is Get-AzureADUserMembership.

Upvotes: 1

Related Questions