You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Export-TargetResource, code attempts to resolve an objectId to a scoped type in an if/then/else block. It may be simpler to call Get-MgDirectoryObjectById instead as it returns the relevant data, e.g. userPrincipalName and/or displayName:
Description of the issue
In Export-TargetResource, code attempts to resolve an objectId to a scoped type in an if/then/else block. It may be simpler to call Get-MgDirectoryObjectById instead as it returns the relevant data, e.g. userPrincipalName and/or displayName:
$userInfo = Get-MgDirectoryObjectById -Ids $request.PrincipalId $principalType = $userInfo.AdditionalProperties['@odata.type'].Split('.')[2] $PrincipalValue = if ($principalType -eq 'user' ) { $userInfo.AdditionalProperties['userPrincipalName]'] } else { $userInfo.AdditionalProperties['displayName'] }
Microsoft 365 DSC Version
DEV/1.25.108.1
Which workloads are affected
Azure Active Directory (Entra ID)
The DSC configuration
Verbose logs showing the problem
Environment Information + PowerShell Version
The text was updated successfully, but these errors were encountered: