Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AADRoleEligibilityScheduleRequest fails when assignments exist in both root and AU #5619

Open
mlhickey opened this issue Jan 10, 2025 · 0 comments

Comments

@mlhickey
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant