Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

SPOAccessControlSettings: Doesn't set CommentsOnSitePagesDisabled

Open ghost opened this issue 1 year ago • 2 comments

Details of the scenario you tried and the problem that is occurring

I wan't to enable comments on site pages in SharePoint Online. Resource SPOAccessControlSettings doesn't set CommentsOnSitePagesDisabled = $False, although Target Values contains correct value (see Verbose logs).

After the configuration is applied, pnp still shows that comments are disabled.

PS C:\> Get-PnPTenant | Select-Object -Property CommentsOnSitePagesDisabled

CommentsOnSitePagesDisabled
---------------------------
                       True

Verbose logs showing the problem

VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'. VERBOSE: An LCM method call arrived from computer WIN with user sid S-1-5-21-979819412-32789266-2779829992-1000. VERBOSE: [WIN]: LCM: [ Start Set ] VERBOSE: [WIN]: LCM: [ Start Resource ] [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] VERBOSE: [WIN]: LCM: [ Start Test ] [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] VERBOSE: [WIN]: [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] Testing configuration of SharePoint Online Access Control Settings VERBOSE: [WIN]: [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] Getting configuration of SharePoint Online Access Control Settings VERBOSE: [WIN]: [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] Current Values: ApplicationId=*** ApplicationSecret=$null CertificatePassword=$null CertificatePath=*** CertificateThumbprint=*** CommentsOnSitePagesDisabled=True Credential=$null DisallowInfectedFileDownload=False DisplayStartASiteOption=True EmailAttestationReAuthDays=30 EmailAttestationRequired=False Ensure=Present ExternalServicesEnabled=True IPAddressAllowList= IPAddressEnforcement=False IPAddressWACTokenLifetime=15 IsSingleInstance=Yes Managedidentity=False SocialBarOnSitePagesDisabled=False StartASiteFormUrl=$null TenantId=*** VERBOSE: [WIN]: [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] Target Values: ApplicationId=*** CertificateThumbprint=*** CommentsOnSitePagesDisabled=False DisallowInfectedFileDownload=False DisplayStartASiteOption=True EmailAttestationReAuthDays=30 EmailAttestationRequired=False Ensure=Present ExternalServicesEnabled=True IPAddressAllowList= IPAddressEnforcement=False IPAddressWACTokenLifetime=15 IsSingleInstance=Yes SocialBarOnSitePagesDisabled=False TenantId=*** Verbose=True VERBOSE: [WIN]: [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] Test-TargetResource returned False VERBOSE: [WIN]: LCM: [ End Test ] [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] in 8.3770 seconds. VERBOSE: [WIN]: LCM: [ Start Set ] [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] VERBOSE: [WIN]: [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] Setting configuration of SharePoint Online Access Control Settings VERBOSE: [WIN]: [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] The IPAddressAllowList is not configured, for that the IPAddressEnforcement parameter can not be set and will be removed VERBOSE: [WIN]: LCM: [ End Set ] [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration] in 2.3910 seconds. VERBOSE: [WIN]: LCM: [ End Resource ] [[SPOAccessControlSettings]SPOAccessControlSettings::[SharePointOnline]Configuration]

Suggested solution to the issue

N/A

The DSC configuration that is used to reproduce the issue (as detailed as possible)

 SPOAccessControlSettings "SPOAccessControlSettings" {
        CommentsOnSitePagesDisabled  = $False
        DisallowInfectedFileDownload = $False
        DisplayStartASiteOption      = $True
        EmailAttestationReAuthDays   = 30
        EmailAttestationRequired     = $False
        Ensure                       = "Present"
        ExternalServicesEnabled      = $True
        IPAddressAllowList           = ""
        IPAddressEnforcement         = $False
        IPAddressWACTokenLifetime    = 15
        IsSingleInstance             = "Yes"
        SocialBarOnSitePagesDisabled = $False
        ApplicationId                = $ApplicationId
        TenantId                     = $TenantId
        CertificateThumbprint        = $CertificateThumbprint
    }

The operating system the target node is running

OsName : Microsoft Windows 10 Pro OsOperatingSystemSKU : 48 OsArchitecture : 64-bit WindowsVersion : 2009 WindowsBuildLabEx : 19041.1.amd64fre.vb_release.191206-1406 OsLanguage : en-US OsMuiLanguages : {en-US}

Version of the DSC module that was used ('dev' if using current dev branch)

1.23.809.1

ghost avatar Aug 15 '23 10:08 ghost

I cannot reproduce this issue with V.1.23.823.1 in my environment...

malauter avatar Aug 30 '23 12:08 malauter

I found out that the parameter 'CommentsOnSitePagesDisabled' is configurable via the resource 'SPOAccessControlSettings' as well as 'SPOTenantSettings'. This creates the conflict in my configuration.

Suggested solution to the issue Remove the parameter from one of the two resources. -> Breaking Change

ghost avatar Sep 14 '23 08:09 ghost