From 102604e86df9adf576a2e06488d7950ed9ae86ba Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 13 Nov 2024 15:58:28 -0500 Subject: [PATCH 1/2] AADRoleEligibilityScheduleRequest - Fix Custom Role assignment at app scope. --- .../MSFT_AADRoleEligibilityScheduleRequest.psm1 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleEligibilityScheduleRequest/MSFT_AADRoleEligibilityScheduleRequest.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleEligibilityScheduleRequest/MSFT_AADRoleEligibilityScheduleRequest.psm1 index c6b343d7b6..51c06e3cf2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleEligibilityScheduleRequest/MSFT_AADRoleEligibilityScheduleRequest.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleEligibilityScheduleRequest/MSFT_AADRoleEligibilityScheduleRequest.psm1 @@ -240,7 +240,20 @@ return $nullResult } $RoleDefinitionId = (Get-MgBetaRoleManagementDirectoryRoleDefinition -Filter "DisplayName eq '$RoleDefinition'").Id - $schedule = Get-MgBetaRoleManagementDirectoryRoleEligibilitySchedule -Filter "PrincipalId eq '$($request.PrincipalId)' and RoleDefinitionId eq '$RoleDefinitionId'" + $schedules = Get-MgBetaRoleManagementDirectoryRoleEligibilitySchedule -Filter "PrincipalId eq '$($request.PrincipalId)'" + $schedule = $schedules | Where-Object -FilterScript {$_.RoleDefinitionId -eq $RoleDefinitionId} + if ($null -eq $schedule) + { + foreach ($instance in $schedules) + { + $roleDefinitionInfo = Get-MgBetaRoleManagementDirectoryRoleDefinition -UnifiedRoleDefinitionId $instance.RoleDefinitionId + if ($null -ne $roleDefinitionInfo -and $RoleDefinitionInfo.DisplayName -eq $RoleDefinition) + { + $schedule = $instance + break + } + } + } } if ($null -eq $schedule -or $null -eq $request) { From 16e2fcef83781f945be7ce51ec81e44196c46ead Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 13 Nov 2024 16:00:20 -0500 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5576768136..b2602b09c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ # UNRELEASED +* AADRoleEligibilityScheduleRequest + * Adds support for custom role assignments at app scope. + +# 1.24.1113.1 + * AADConditionalAccessPolicy * Fixed bug where an empty value was passed in the request for the insiderRiskLevels parameter, which throws an error.