Skip to content

Additional parameters to Set-PnPTenant cmdlet #4996

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

Merged
merged 1 commit into from
Jul 3, 2025
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
38 changes: 38 additions & 0 deletions documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -3022,6 +3022,44 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -AllowClassicPublishingSiteCreation
This parameter allows creation of classic publishing site collections (templates `BLANKINTERNETCONTAINER#0, CMSPUBLISHING#0 and BLANKINTERNET#0`) and activation of classic publishing features in sites.

The valid values are:

- False (default) - Classic publishing site collections cannot be created and the publishing features cannot be activated in sites.
- True - Classic publishing site collections can be created and the publishing features can be activated in sites.

```yaml
Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -DelayDenyAddAndCustomizePagesEnforcementOnClassicPublishingSites
This parameter controls how SharePoint will deal with classic publishing sites (templates `BLANKINTERNETCONTAINER#0, CMSPUBLISHING#0 and BLANKINTERNET#0`) where custom scripts are allowed.

The valid values are:

- False (default) - for classic publishing site collections where administrators enabled the ability to add custom script, SharePoint will revoke that ability within 24 hours from the last time this setting was changed.
- True - All changes performed by administrators to custom script settings are preserved.

```yaml
Type: Boolean
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
38 changes: 27 additions & 11 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -489,39 +489,45 @@ public class SetTenant : PnPSharePointOnlineAdminCmdlet
[Parameter(Mandatory = false)]
public string WhoCanShareAllowListInTenant { private set; get; }

[Parameter(Mandatory = false)]
[Parameter(Mandatory = false)]
public bool? LegacyBrowserAuthProtocolsEnabled { private set; get; }

[Parameter(Mandatory = false)]
[Parameter(Mandatory = false)]
public bool? EnableDiscoverableByOrganizationForVideos { private set; get; }

[Parameter(Mandatory = false)]
[Parameter(Mandatory = false)]
public string RestrictedAccessControlforSitesErrorHelpLink { private set; get; }

[Parameter(Mandatory = false)]
[Parameter(Mandatory = false)]
public bool? Workflow2010Disabled { private set; get; }

[Parameter(Mandatory = false)]
[Parameter(Mandatory = false)]
public bool? AllowSharingOutsideRestrictedAccessControlGroups { private set; get; }

[Parameter(Mandatory = false)]
[Parameter(Mandatory = false)]
public bool? HideSyncButtonOnDocLib { private set; get; }

[Parameter(Mandatory = false)]
[Parameter(Mandatory = false)]
public bool? HideSyncButtonOnODB { private set; get; }

[Parameter(Mandatory = false)]
[Parameter(Mandatory = false)]
public int? StreamLaunchConfig { private set; get; }

[Parameter(Mandatory = false)]
[Parameter(Mandatory = false)]
public bool? EnableMediaReactions { private set; get; }

[Parameter(Mandatory = false)]
[Parameter(Mandatory = false)]
public bool? ContentSecurityPolicyEnforcement { private set; get; }

[Parameter(Mandatory = false)]
public bool? DisableSpacesActivation { private set; get; }


[Parameter(Mandatory = false)]
public bool? AllowClassicPublishingSiteCreation { private set; get; }

[Parameter(Mandatory = false)]
public bool? DelayDenyAddAndCustomizePagesEnforcementOnClassicPublishingSites { private set; get; }

protected override void ExecuteCmdlet()
{
AdminContext.Load(Tenant);
Expand Down Expand Up @@ -1652,6 +1658,16 @@ protected override void ExecuteCmdlet()
Tenant.DisableSpacesActivation = DisableSpacesActivation.Value;
modified = true;
}
if (AllowClassicPublishingSiteCreation.HasValue)
{
Tenant.AllowClassicPublishingSiteCreation = AllowClassicPublishingSiteCreation.Value;
modified = true;
}
if (DelayDenyAddAndCustomizePagesEnforcementOnClassicPublishingSites.HasValue)
{
Tenant.DelayDenyAddAndCustomizePagesEnforcementOnClassicPublishingSites = DelayDenyAddAndCustomizePagesEnforcementOnClassicPublishingSites.Value;
modified = true;
}
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity != null)
{
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity.Length > 0)
Expand Down
Loading