Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
[-OneDriveSharingCapability <SharingCapabilities>]
[-DelayDenyAddAndCustomizePagesEnforcement <Boolean>]
[-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled <Boolean>]
[-SelfServiceSiteCreationDisabled <Boolean>]
[-SyncAadB2BManagementPolicy]
[-Force] [-Connection <PnPConnection>]
```

Expand Down Expand Up @@ -2829,6 +2831,35 @@ 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

Expand Down
18 changes: 16 additions & 2 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ public class SetTenant : PnPAdminCmdlet
[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);
Expand Down Expand Up @@ -1547,6 +1553,16 @@ protected override void ExecuteCmdlet()
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)
Expand Down Expand Up @@ -1594,7 +1610,6 @@ protected override void ExecuteCmdlet()
}
modified = true;
}

}
else if (ExcludedBlockDownloadGroupIds != null)
{
Expand All @@ -1605,7 +1620,6 @@ protected override void ExecuteCmdlet()
Tenant.SetBlockDownloadFileTypePolicyExclusionList(ExcludedBlockDownloadGroupIds);
modified = true;
}

if (modified)
{
AdminContext.ExecuteQueryRetry();
Expand Down
4 changes: 4 additions & 0 deletions src/Commands/Model/SPOTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ public class SPOTenant
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)
Expand Down Expand Up @@ -773,6 +775,8 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
try { OneDriveSharingCapability = tenant.ODBSharingCapability; } catch { }
try { GuestSharingGroupAllowListInTenantByPrincipalIdentity = tenant.GuestSharingGroupAllowListInTenantByPrincipalIdentity?.ToArray(); } catch { }
try { AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled; } catch { }
try { SelfServiceSiteCreationDisabled = tenant.SelfServiceSiteCreationDisabled; } catch { }
}
}
}