Azure / Azure/Azure-Governance-Visualizer

Role Assignments - foreign Principals

Open
#66 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
184
Forks
72
PR merge metrics
No merged PRs in 30d

Description

Identity Displayname and also the Identity Type in the Role Assignments are currently not displayed for Foreign Identities (like Partner Admins from other Tenants).

The code which quries the DirectoryObjectId (principalId) details must contain types in the request body and include ("user","group","servicePrincipal","device","directoryObjectPartnerReference").
Without directoryObjectPartnerReference foreign Principals, like Partner Admins will not be queried.

$uri = "$($azAPICallConf['azAPIEndpointUrls'].MicrosoftGraph)/beta/directoryObjects/getByIds"
$method = 'POST'
$body = @"
{
"ids":[$($objectsToProcess)]
}

in graph it works this way:
$principalId = $id
$body = @{
ids = @($objectsToProcess)
types = @("user","group","servicePrincipal","device","directoryObjectPartnerReference")
}

(Invoke-MgGraphRequest -Method POST `
-Uri /v1.0/directoryObjects/getByIds `
-Body ($body | ConvertTo-Json -Depth 5) `
-OutputType PSObject).Value

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.