From f4697961c1336d837fff5f0a2dc63a6008b9e0cb Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 17 Jan 2025 11:24:40 +0100 Subject: [PATCH 1/3] Fixing #5602 --- CHANGELOG.md | 3 +++ .../DSCResources/MSFT_AADRoleSetting/MSFT_AADRoleSetting.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab8076be04..c424fabb69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ * AADDeviceRegistrationPolicy * Fixes an error when trying to disable AAD join. +* AADRoleSetting + * Fixed issue where missing settings object for a role caused errors. + FIXES [#5602](https://github.com/microsoft/Microsoft365DSC/issues/5602) * FabricAdminTenantSettings * Added support for the AllowGetOneLakeUDK, AllowMountDfCreation, AllowOneLakeUDK, ArtifactOrgAppPreview properties. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleSetting/MSFT_AADRoleSetting.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleSetting/MSFT_AADRoleSetting.psm1 index 2af52a4d70..c3a63acd65 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleSetting/MSFT_AADRoleSetting.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleSetting/MSFT_AADRoleSetting.psm1 @@ -278,7 +278,7 @@ function Get-TargetResource } #get Policyrule - $role = Get-MgBetaPolicyRoleManagementPolicyRule -UnifiedRoleManagementPolicyId $Policy.Policyid + $role = Get-MgBetaPolicyRoleManagementPolicyRule -UnifiedRoleManagementPolicyId $Policy.Policyid -ErrorAction SilentlyContinue $DisplayName = $RoleDefinition.DisplayName $ActivationMaxDuration = ($role | Where-Object { $_.Id -eq 'Expiration_EndUser_Assignment' }).AdditionalProperties.maximumDuration From 724d535ebee6f5129c154adc17d7451f31ad42ed Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 17 Jan 2025 11:24:40 +0100 Subject: [PATCH 2/3] Fixing #5602 --- CHANGELOG.md | 3 +++ .../DSCResources/MSFT_AADRoleSetting/MSFT_AADRoleSetting.psm1 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad8f07468f..f6a0498929 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ * FIXES [#5549](https://github.com/microsoft/Microsoft365DSC/issues/5549) * AADDeviceRegistrationPolicy * Fixes an error when trying to disable AAD join. +* AADRoleSetting + * Fixed issue where missing settings object for a role caused errors. + FIXES [#5602](https://github.com/microsoft/Microsoft365DSC/issues/5602) * FabricAdminTenantSettings * Added support for the AllowGetOneLakeUDK, AllowMountDfCreation, AllowOneLakeUDK, ArtifactOrgAppPreview properties. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleSetting/MSFT_AADRoleSetting.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleSetting/MSFT_AADRoleSetting.psm1 index 2af52a4d70..c3a63acd65 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleSetting/MSFT_AADRoleSetting.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADRoleSetting/MSFT_AADRoleSetting.psm1 @@ -278,7 +278,7 @@ function Get-TargetResource } #get Policyrule - $role = Get-MgBetaPolicyRoleManagementPolicyRule -UnifiedRoleManagementPolicyId $Policy.Policyid + $role = Get-MgBetaPolicyRoleManagementPolicyRule -UnifiedRoleManagementPolicyId $Policy.Policyid -ErrorAction SilentlyContinue $DisplayName = $RoleDefinition.DisplayName $ActivationMaxDuration = ($role | Where-Object { $_.Id -eq 'Expiration_EndUser_Assignment' }).AdditionalProperties.maximumDuration From 0598d890a134efc26ff6f89c903ab2dbab9661cf Mon Sep 17 00:00:00 2001 From: Yorick Kuijs Date: Fri, 17 Jan 2025 11:28:52 +0100 Subject: [PATCH 3/3] Corrected changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6a0498929..c24b24b8d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,13 @@ # UNRELEASED -* AADServicePrincipal - * FIXES [#5549](https://github.com/microsoft/Microsoft365DSC/issues/5549) * AADDeviceRegistrationPolicy * Fixes an error when trying to disable AAD join. * AADRoleSetting * Fixed issue where missing settings object for a role caused errors. FIXES [#5602](https://github.com/microsoft/Microsoft365DSC/issues/5602) +* AADServicePrincipal + * FIXES [#5549](https://github.com/microsoft/Microsoft365DSC/issues/5549) * FabricAdminTenantSettings * Added support for the AllowGetOneLakeUDK, AllowMountDfCreation, AllowOneLakeUDK, ArtifactOrgAppPreview properties.