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
Since RoleDefinitionId is shared across scopes, in the case where an object has the role assigned in both scopes the return set is an array and not a single object. This results in failure at $expirationValue.Add('endDateTime', $schedule.ScheduleInfo.Expiration.EndDateTime.ToString('yyyy-MM-ddThh:mm:ssZ'))
Recommendation is to filter $schedules based on both RoleDefinitionId and DirectoryScopeId: $schedule = $schedules | Where-Object -FilterScript { $_.RoleDefinitionId -eq $RoleDefinitionId -and $_.DirectoryScopeId -eq "$($DirectoryScopeId)" }
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:
Description of the issue
Since RoleDefinitionId is shared across scopes, in the case where an object has the role assigned in both scopes the return set is an array and not a single object. This results in failure at
$expirationValue.Add('endDateTime', $schedule.ScheduleInfo.Expiration.EndDateTime.ToString('yyyy-MM-ddThh:mm:ssZ'))
Recommendation is to filter $schedules based on both RoleDefinitionId and DirectoryScopeId:
$schedule = $schedules | Where-Object -FilterScript { $_.RoleDefinitionId -eq $RoleDefinitionId -and $_.DirectoryScopeId -eq "$($DirectoryScopeId)" }
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: