Skip to content

Commit 8b05513

Browse files
committed
Add AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled, SelfServiceSiteCreationDisabled, SyncAadB2BManagementPolicy
1 parent 678c210 commit 8b05513

File tree

3 files changed

+75
-2
lines changed

3 files changed

+75
-2
lines changed

documentation/Set-PnPTenant.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
160160
[-GuestSharingGroupAllowListInTenantByPrincipalIdentity <string[]>]
161161
[-OneDriveSharingCapability <SharingCapabilities>]
162162
[-DelayDenyAddAndCustomizePagesEnforcement <Boolean>]
163+
[-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled <Boolean>]
164+
[-SelfServiceSiteCreationDisabled <Boolean>]
165+
[-SyncAadB2BManagementPolicy]
163166
[-Force] [-Connection <PnPConnection>]
164167
```
165168

@@ -2814,6 +2817,49 @@ Accept pipeline input: False
28142817
Accept wildcard characters: False
28152818
```
28162819

2820+
### -AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled
2821+
Sets whether web property bag update is allowed when DenyAddAndCustomizePages is enabled.
2822+
2823+
```yaml
2824+
Type: Boolean
2825+
Parameter Sets: (All)
2826+
2827+
Required: False
2828+
Position: Named
2829+
Default value: None
2830+
Accept pipeline input: False
2831+
Accept wildcard characters: False
2832+
```
2833+
2834+
### -SelfServiceSiteCreationDisabled
2835+
Sets whether self-service site creation is disabled.
2836+
2837+
```yaml
2838+
Type: Boolean
2839+
Parameter Sets: (All)
2840+
2841+
Required: False
2842+
Position: Named
2843+
Default value: None
2844+
Accept pipeline input: False
2845+
Accept wildcard characters: False
2846+
```
2847+
2848+
### -SyncAadB2BManagementPolicy
2849+
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.
2850+
2851+
2852+
```yaml
2853+
Type: SwitchParameter
2854+
Parameter Sets: (All)
2855+
2856+
Required: False
2857+
Position: Named
2858+
Default value: None
2859+
Accept pipeline input: False
2860+
Accept wildcard characters: False
2861+
```
2862+
28172863
### -Force
28182864
If provided, no confirmation will be requested and the action will be performed
28192865

src/Commands/Admin/SetTenant.cs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,15 @@ public class SetTenant : PnPAdminCmdlet
480480
[Parameter(Mandatory = false)]
481481
public string[] GuestSharingGroupAllowListInTenantByPrincipalIdentity { private set; get; }
482482

483+
[Parameter(Mandatory = false)]
484+
public bool? AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled { private set; get; }
485+
486+
[Parameter(Mandatory = false)]
487+
public bool? SelfServiceSiteCreationDisabled { private set; get; }
488+
489+
[Parameter(Mandatory = false)]
490+
public SwitchParameter SyncAadB2BManagementPolicy { private set; get; }
491+
483492
protected override void ExecuteCmdlet()
484493
{
485494
AdminContext.Load(Tenant);
@@ -1539,6 +1548,21 @@ protected override void ExecuteCmdlet()
15391548
Tenant.ODBSharingCapability = OneDriveSharingCapability.Value;
15401549
modified = true;
15411550
}
1551+
if (AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.HasValue)
1552+
{
1553+
Tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.Value;
1554+
modified = true;
1555+
}
1556+
if (SelfServiceSiteCreationDisabled.HasValue)
1557+
{
1558+
Tenant.SelfServiceSiteCreationDisabled = SelfServiceSiteCreationDisabled.Value;
1559+
modified = true;
1560+
}
1561+
if (SyncAadB2BManagementPolicy)
1562+
{
1563+
Tenant.SyncAadB2BManagementPolicy();
1564+
modified = true;
1565+
}
15421566
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity !=null)
15431567
{
15441568
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity.Length > 0)
@@ -1586,7 +1610,6 @@ protected override void ExecuteCmdlet()
15861610
}
15871611
modified = true;
15881612
}
1589-
15901613
}
15911614
else if (ExcludedBlockDownloadGroupIds != null)
15921615
{
@@ -1597,7 +1620,6 @@ protected override void ExecuteCmdlet()
15971620
Tenant.SetBlockDownloadFileTypePolicyExclusionList(ExcludedBlockDownloadGroupIds);
15981621
modified = true;
15991622
}
1600-
16011623
if (modified)
16021624
{
16031625
AdminContext.ExecuteQueryRetry();

src/Commands/Model/SPOTenant.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ public class SPOTenant
250250
public bool? SharePointAddInsDisabled { private set; get; }
251251
public SharingCapabilities? OneDriveSharingCapability { private set; get; }
252252
public string[] GuestSharingGroupAllowListInTenantByPrincipalIdentity { private set; get; }
253+
public bool? AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled { private set; get; }
254+
public bool? SelfServiceSiteCreationDisabled { private set; get; }
253255
#endregion
254256

255257
public SPOTenant(Tenant tenant, ClientContext clientContext)
@@ -789,6 +791,9 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
789791
try { SharePointAddInsDisabled = tenant.SharePointAddInsDisabled; } catch { }
790792
try { OneDriveSharingCapability = tenant.ODBSharingCapability; } catch { }
791793
try { GuestSharingGroupAllowListInTenantByPrincipalIdentity = tenant.GuestSharingGroupAllowListInTenantByPrincipalIdentity?.ToArray(); } catch { }
794+
try { AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled; } catch { }
795+
try { SelfServiceSiteCreationDisabled = tenant.SelfServiceSiteCreationDisabled; } catch { }
792796
}
793797
}
794798
}
799+

0 commit comments

Comments
 (0)