Microsoft365DSC
Microsoft365DSC copied to clipboard
SPOSite is not idempotent because of RestrictedToRegion
Description of the issue
Issue between schema definition and parameters in PnP cmdlet
Schema uses RestrictedToRegion, Set-PnPSite uses -RestrictedToGeo as parameter
https://github.com/microsoft/Microsoft365DSC/blob/0c6c2ec1c38177c96439ff96a5f1efa232554fcb/Modules/Microsoft365DSC/DSCResources/MSFT_SPOSite/MSFT_SPOSite.schema.mof#L21
Microsoft 365 DSC Version
1.25.1112.1
Which workloads are affected
SharePoint Online
The DSC configuration
# Generated with Microsoft365DSC version 1.25.1112.1
# For additional information on how to use Microsoft365DSC, please visit https://aka.ms/M365DSC
param (
)
Configuration M365TenantConfig
{
param (
)
$OrganizationName = $ConfigurationData.NonNodeData.OrganizationName
Import-DscResource -ModuleName 'Microsoft365DSC'
Node localhost
{
SPOSite "SPOSite-MockupSite"
{
AllowSelfServiceUpgrade = $True;
AnonymousLinkExpirationInDays = 0;
ApplicationId = $ConfigurationData.NonNodeData.ApplicationId;
CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint;
CommentsOnSitePagesDisabled = $False;
DefaultLinkPermission = "None";
DefaultSharingLinkType = "None";
DenyAddAndCustomizePages = $True;
DisableAppViews = "NotDisabled";
DisableCompanyWideSharingLinks = "NotDisabled";
DisableFlows = $False;
Ensure = "Present";
LocaleId = 1033;
OverrideTenantAnonymousLinkExpirationPolicy = $False;
Owner = "spowner_or_anythingelse@$($OrganizationName)";
RestrictedToRegion = "Unknown";
SharingCapability = "ExistingExternalUserSharingOnly";
SharingDomainRestrictionMode = "None";
ShowPeoplePickerSuggestionsForGuestUsers = $False;
SocialBarOnSitePagesDisabled = $False;
StorageMaximumLevel = 26214400;
StorageWarningLevel = 25574400;
Template = "STS#3";
TenantId = $OrganizationName;
TimeZoneId = 3;
Title = "MockupSite";
Url = "https://$($OrganizationName.Split('.')[0]).sharepoint.com/sites/MockupSite";
}
}
}
M365TenantConfig -ConfigurationData .\ConfigurationData.psd1
Verbose logs showing the problem
A parameter cannot be found that matches parameter name 'RestrictedToRegion'.
+ CategoryInfo : InvalidArgument: (:) [], CimException
+ FullyQualifiedErrorId : NamedParameterNotFound,PnP.PowerShell.Commands.SetTenantSite
+ PSComputerName : localhost
Environment Information + PowerShell Version
OsName : Microsoft Windows Server 2022 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture : 64-bit
WindowsVersion : 2009
WindowsBuildLabEx : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage : en-US
OsMuiLanguages : {en-US}
Name Value
---- -----
PSVersion 5.1.20348.4294
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.20348.4294
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1