Skip to content

Role Assignments - foreign Principals #66

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions