Skip to content

Role Assignments - foreign Principals #298

Description

@milosbithawk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions