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
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.
$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