diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ba3b82a9c..576a6ed763 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ * AADRoleEligibilityScheduleRequest * Fixes how the Get method retrieves existing instances for Groups. FIXES [#3787](https://github.com/microsoft/Microsoft365DSC/issues/3787) +* SPOSharingSettings + * Fixes parameter validation of ExternalUserExpireInDays and ExternalUserExpirationRequired. + FIXES [#3856](https://github.com/microsoft/Microsoft365DSC/issues/3856) # 1.23.1025.1 diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 index 3511c3159f..f56913aaa1 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 @@ -447,9 +447,9 @@ function Set-TargetResource Write-Warning -Message 'The sharing capabilities for the tenant are not configured to be ExternalUserAndGuestSharing for that the RequireAnonymousLinksExpireInDays property cannot be configured' $CurrentParameters.Remove('RequireAnonymousLinksExpireInDays') | Out-Null } - if ($SharingCapability -ne 'ExternalUserExpirationRequired') + if ($ExternalUserExpireInDays -and $ExternalUserExpirationRequired -eq $false) { - Write-Warning -Message 'The sharing capabilities for the tenant are not configured to be ExternalUserExpirationRequired for that the ExternalUserExpireInDays property cannot be configured' + Write-Warning -Message 'ExternalUserExpirationRequired is set to be false. For that the ExternalUserExpireInDays property cannot be configured' $CurrentParameters.Remove('ExternalUserExpireInDays') | Out-Null } if ($RequireAcceptingAccountMatchInvitedAccount -eq $false)