Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tenant settings like AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled #4503

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
46 changes: 46 additions & 0 deletions documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
[-GuestSharingGroupAllowListInTenantByPrincipalIdentity <string[]>]
[-OneDriveSharingCapability <SharingCapabilities>]
[-DelayDenyAddAndCustomizePagesEnforcement <Boolean>]
[-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled <Boolean>]
[-SelfServiceSiteCreationDisabled <Boolean>]
[-SyncAadB2BManagementPolicy]
[-Force] [-Connection <PnPConnection>]
```

Expand Down Expand Up @@ -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

Expand Down
26 changes: 24 additions & 2 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1586,7 +1610,6 @@ protected override void ExecuteCmdlet()
}
modified = true;
}

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

if (modified)
{
AdminContext.ExecuteQueryRetry();
Expand Down
5 changes: 5 additions & 0 deletions src/Commands/Model/SPOTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 { }
}
}
}

Loading