diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ba895ab13..0ccb99ff9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,9 @@ * Fix typo in variable which made it export incorrectly and report that resource was not in correct state due to testing an incorrect value FIXES [#3972](https://github.com/microsoft/Microsoft365DSC/issues/3972) +* SPOSharingSettings + * Fixed an issue where the resource would return multiple sites. + FIXES [#2759](https://github.com/microsoft/Microsoft365DSC/issues/2759) * DEPENDENCIES * Updated DSCParser to version 1.4.0.2. * Updated Microsoft.Graph dependencies to version 2.13.1. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 index b8dd694459..b8c873870f 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSharingSettings/MSFT_SPOSharingSettings.psm1 @@ -520,7 +520,7 @@ function Set-TargetResource Set-PnPTenant @CurrentParameters | Out-Null if ($SetMySharingCapability) { - $mysite = Get-PnPTenantSite | Where-Object { $_.Url -match '-my.sharepoint.com/' } + $mysite = Get-PnPTenantSite | Where-Object { $_.Url -match '-my.sharepoint.com/' -and $_.Template -notmatch '^RedirectSite#' } Set-PnPTenantSite -Identity $mysite.Url -SharingCapability $MySiteSharingCapability } }