diff --git a/documentation/Set-PnPTenant.md b/documentation/Set-PnPTenant.md index 399ce7c63..e9d4f38fa 100644 --- a/documentation/Set-PnPTenant.md +++ b/documentation/Set-PnPTenant.md @@ -160,6 +160,9 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames [-GuestSharingGroupAllowListInTenantByPrincipalIdentity ] [-OneDriveSharingCapability ] [-DelayDenyAddAndCustomizePagesEnforcement ] + [-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled ] + [-SelfServiceSiteCreationDisabled ] + [-SyncAadB2BManagementPolicy] [-Force] [-Connection ] ``` @@ -2814,6 +2817,49 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled +Sets whether web property bag update is allowed when DenyAddAndCustomizePages is enabled. + +```yaml +Type: Boolean +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SelfServiceSiteCreationDisabled +Sets whether self-service site creation is disabled. + +```yaml +Type: Boolean +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SyncAadB2BManagementPolicy +This feature allows SharePoint Online to synchronize several Entra B2B collaboration settings [Guest user access restriction and collaboration restriction](https://learn.microsoft.com/en-us/entra/external-id/external-collaboration-settings-configure#configure-settings-in-the-portal), and store them on SharePoint Online tenant store. On sharing, SharePoint checks whether those synchronized settings are blocking sharing before sending invitation requests to Entra B2B invitation manager. The sync might take up to 24 hours to complete if you change those Entra B2B collaboration settings. To make the change effective on SharePoint Online immediately, run 'Set-PnPTenant -SyncAadB2BManagementPolicy' and it forces a sync from Microsoft Entra. + + +```yaml +Type: SwitchParameter +Parameter Sets: (All) + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Force If provided, no confirmation will be requested and the action will be performed diff --git a/src/Commands/Admin/SetTenant.cs b/src/Commands/Admin/SetTenant.cs index 2bf51e519..d91144664 100644 --- a/src/Commands/Admin/SetTenant.cs +++ b/src/Commands/Admin/SetTenant.cs @@ -480,6 +480,15 @@ public class SetTenant : PnPAdminCmdlet [Parameter(Mandatory = false)] public string[] GuestSharingGroupAllowListInTenantByPrincipalIdentity { private set; get; } + [Parameter(Mandatory = false)] + public bool? AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled { private set; get; } + + [Parameter(Mandatory = false)] + public bool? SelfServiceSiteCreationDisabled { private set; get; } + + [Parameter(Mandatory = false)] + public SwitchParameter SyncAadB2BManagementPolicy { private set; get; } + protected override void ExecuteCmdlet() { AdminContext.Load(Tenant); @@ -1539,6 +1548,21 @@ protected override void ExecuteCmdlet() Tenant.ODBSharingCapability = OneDriveSharingCapability.Value; modified = true; } + if (AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.HasValue) + { + Tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.Value; + modified = true; + } + if (SelfServiceSiteCreationDisabled.HasValue) + { + Tenant.SelfServiceSiteCreationDisabled = SelfServiceSiteCreationDisabled.Value; + modified = true; + } + if (SyncAadB2BManagementPolicy) + { + Tenant.SyncAadB2BManagementPolicy(); + modified = true; + } if (GuestSharingGroupAllowListInTenantByPrincipalIdentity !=null) { if (GuestSharingGroupAllowListInTenantByPrincipalIdentity.Length > 0) @@ -1586,7 +1610,6 @@ protected override void ExecuteCmdlet() } modified = true; } - } else if (ExcludedBlockDownloadGroupIds != null) { @@ -1597,7 +1620,6 @@ protected override void ExecuteCmdlet() Tenant.SetBlockDownloadFileTypePolicyExclusionList(ExcludedBlockDownloadGroupIds); modified = true; } - if (modified) { AdminContext.ExecuteQueryRetry(); diff --git a/src/Commands/Model/SPOTenant.cs b/src/Commands/Model/SPOTenant.cs index 0bac35231..d5bdd13ff 100644 --- a/src/Commands/Model/SPOTenant.cs +++ b/src/Commands/Model/SPOTenant.cs @@ -250,6 +250,8 @@ public class SPOTenant public bool? SharePointAddInsDisabled { private set; get; } public SharingCapabilities? OneDriveSharingCapability { private set; get; } public string[] GuestSharingGroupAllowListInTenantByPrincipalIdentity { private set; get; } + public bool? AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled { private set; get; } + public bool? SelfServiceSiteCreationDisabled { private set; get; } #endregion public SPOTenant(Tenant tenant, ClientContext clientContext) @@ -789,6 +791,9 @@ public SPOTenant(Tenant tenant, ClientContext clientContext) try { SharePointAddInsDisabled = tenant.SharePointAddInsDisabled; } catch { } try { OneDriveSharingCapability = tenant.ODBSharingCapability; } catch { } try { GuestSharingGroupAllowListInTenantByPrincipalIdentity = tenant.GuestSharingGroupAllowListInTenantByPrincipalIdentity?.ToArray(); } catch { } + try { AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled; } catch { } + try { SelfServiceSiteCreationDisabled = tenant.SelfServiceSiteCreationDisabled; } catch { } } } } + \ No newline at end of file