Skip to content

Commit a5fcb26

Browse files
authored
Merge pull request #4503 from reshmee011/tenantsetting
Add Tenant settings like AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled
2 parents 0f21309 + ac6fa88 commit a5fcb26

File tree

3 files changed

+51
-2
lines changed

3 files changed

+51
-2
lines changed

documentation/Set-PnPTenant.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
161161
[-OneDriveSharingCapability <SharingCapabilities>]
162162
[-DelayDenyAddAndCustomizePagesEnforcement <Boolean>]
163163
[-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled <Boolean>]
164+
[-SelfServiceSiteCreationDisabled <Boolean>]
165+
[-SyncAadB2BManagementPolicy]
164166
[-Force] [-Connection <PnPConnection>]
165167
```
166168

@@ -2829,6 +2831,35 @@ Accept pipeline input: False
28292831
Accept wildcard characters: False
28302832
```
28312833

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+
28322863
### -Force
28332864
If provided, no confirmation will be requested and the action will be performed
28342865

src/Commands/Admin/SetTenant.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,12 @@ public class SetTenant : PnPAdminCmdlet
483483
[Parameter(Mandatory = false)]
484484
public bool? AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled { private set; get; }
485485

486+
[Parameter(Mandatory = false)]
487+
public bool? SelfServiceSiteCreationDisabled { private set; get; }
488+
489+
[Parameter(Mandatory = false)]
490+
public SwitchParameter SyncAadB2BManagementPolicy { private set; get; }
491+
486492
protected override void ExecuteCmdlet()
487493
{
488494
AdminContext.Load(Tenant);
@@ -1547,6 +1553,16 @@ protected override void ExecuteCmdlet()
15471553
Tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.Value;
15481554
modified = true;
15491555
}
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+
}
15501566
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity !=null)
15511567
{
15521568
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity.Length > 0)
@@ -1594,7 +1610,6 @@ protected override void ExecuteCmdlet()
15941610
}
15951611
modified = true;
15961612
}
1597-
15981613
}
15991614
else if (ExcludedBlockDownloadGroupIds != null)
16001615
{
@@ -1605,7 +1620,6 @@ protected override void ExecuteCmdlet()
16051620
Tenant.SetBlockDownloadFileTypePolicyExclusionList(ExcludedBlockDownloadGroupIds);
16061621
modified = true;
16071622
}
1608-
16091623
if (modified)
16101624
{
16111625
AdminContext.ExecuteQueryRetry();

src/Commands/Model/SPOTenant.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ public class SPOTenant
251251
public SharingCapabilities? OneDriveSharingCapability { private set; get; }
252252
public string[] GuestSharingGroupAllowListInTenantByPrincipalIdentity { private set; get; }
253253
public bool? AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled { private set; get; }
254+
public bool? SelfServiceSiteCreationDisabled { private set; get; }
255+
254256
#endregion
255257

256258
public SPOTenant(Tenant tenant, ClientContext clientContext)
@@ -773,6 +775,8 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
773775
try { OneDriveSharingCapability = tenant.ODBSharingCapability; } catch { }
774776
try { GuestSharingGroupAllowListInTenantByPrincipalIdentity = tenant.GuestSharingGroupAllowListInTenantByPrincipalIdentity?.ToArray(); } catch { }
775777
try { AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled; } catch { }
778+
try { SelfServiceSiteCreationDisabled = tenant.SelfServiceSiteCreationDisabled; } catch { }
776779
}
777780
}
778781
}
782+

0 commit comments

Comments
 (0)