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

Additional properties added to update at tenant level #4681

Open
wants to merge 3 commits 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
181 changes: 181 additions & 0 deletions documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,18 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
[-SelfServiceSiteCreationDisabled <Boolean>]
[-SyncAadB2BManagementPolicy]
[-ExtendPermissionsToUnprotectedFiles <Boolean>]
[-WhoCanShareAllowListInTenant <String>]
[-LegacyBrowserAuthProtocolsEnabled <Boolean>]
[-EnableDiscoverableByOrganizationForVideos <Boolean>]
[-RestrictedAccessControlforSitesErrorHelpLink <String>]
[-Workflow2010Disabled <Boolean>]
[-AllowSharingOutsideRestrictedAccessControlGroups <Boolean>]
[-HideSyncButtonOnDocLib <Boolean>]
[-HideSyncButtonOnODB <Boolean>]
[-StreamLaunchConfig <Int32>]
[-EnableMediaReactions <Boolean>]
[-ContentSecurityPolicyEnforcement <Boolean>]
[-DisableSpacesActivation <Boolean>]
[-Force] [-Connection <PnPConnection>]
```

Expand Down Expand Up @@ -2841,6 +2853,175 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -WhoCanShareAllowListInTenant
Sets a value to handle the tenant who can share settings

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

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


### -LegacyBrowserAuthProtocolsEnabled
Enables or disables legacy browser authentication protocols.

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

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

### -EnableDiscoverableByOrganizationForVideos
Enables or disables the sharing dialog to include a checkbox offering the user the ability to share to a security group containing every user in the organization.

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

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

### -RestrictedAccessControlforSitesErrorHelpLink
Sets a custom learn more link to inform users who were denied access to a SharePoint site due to the restricted site access control policy.

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

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

### -Workflow2010Disabled
Sets a value to specify whether Workflow 2010 is disabled.

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

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

### -AllowSharingOutsideRestrictedAccessControlGroups
Controls whether sharing SharePoint sites and their content is allowed with users and groups who are not allowed as per the Restricted access control policy.

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

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

### -HideSyncButtonOnDocLib
Sets a value to specify whether the sync button on document libraries is hidden.

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

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

### -HideSyncButtonOnODB
Set whether to hide the sync button on OneDrive for Business sites.

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

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

### -StreamLaunchConfig
Sets the default destination for the Stream app launcher tile.

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

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

### -EnableMediaReactions
Controls whether media reactions are enabled.

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

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

### -ContentSecurityPolicyEnforcement
Controls whether content security policy is enabled.

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

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

### -DisableSpacesActivation
Enables or disables activation of spaces.

```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
95 changes: 95 additions & 0 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,42 @@ public class SetTenant : PnPAdminCmdlet
[Parameter(Mandatory = false)]
public bool? ExtendPermissionsToUnprotectedFiles { private set; get; }

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

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

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

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

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

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

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

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

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

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

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

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

protected override void ExecuteCmdlet()
{
AdminContext.Load(Tenant);
Expand Down Expand Up @@ -1557,6 +1592,66 @@ protected override void ExecuteCmdlet()
Tenant.ExtendPermissionsToUnprotectedFiles = ExtendPermissionsToUnprotectedFiles.Value;
modified = true;
}
if (WhoCanShareAllowListInTenant != null)
{
Tenant.WhoCanShareAllowListInTenant = WhoCanShareAllowListInTenant;
modified = true;
}
if (LegacyBrowserAuthProtocolsEnabled.HasValue)
{
Tenant.LegacyBrowserAuthProtocolsEnabled = LegacyBrowserAuthProtocolsEnabled.Value;
modified = true;
}
if (EnableDiscoverableByOrganizationForVideos.HasValue)
{
Tenant.EnableDiscoverableByOrganizationForVideos = EnableDiscoverableByOrganizationForVideos.Value;
modified = true;
}
if (RestrictedAccessControlforSitesErrorHelpLink != null)
{
Tenant.RestrictedAccessControlforSitesErrorHelpLink = RestrictedAccessControlforSitesErrorHelpLink;
modified = true;
}
if (Workflow2010Disabled.HasValue)
{
Tenant.Workflow2010Disabled = Workflow2010Disabled.Value;
modified = true;
}
if (AllowSharingOutsideRestrictedAccessControlGroups.HasValue)
{
Tenant.AllowSharingOutsideRestrictedAccessControlGroups = AllowSharingOutsideRestrictedAccessControlGroups.Value;
modified = true;
}
if (HideSyncButtonOnDocLib.HasValue)
{
Tenant.HideSyncButtonOnDocLib = HideSyncButtonOnDocLib.Value;
modified = true;
}
if (HideSyncButtonOnODB.HasValue)
{
Tenant.HideSyncButtonOnODB = HideSyncButtonOnODB.Value;
modified = true;
}
if (StreamLaunchConfig.HasValue)
{
Tenant.StreamLaunchConfig = StreamLaunchConfig.Value;
modified = true;
}
if (EnableMediaReactions.HasValue)
{
Tenant.EnableMediaReactions = EnableMediaReactions.Value;
modified = true;
}
if (ContentSecurityPolicyEnforcement.HasValue)
{
Tenant.ContentSecurityPolicyEnforcement = ContentSecurityPolicyEnforcement.Value;
modified = true;
}
if (DisableSpacesActivation.HasValue)
{
Tenant.DisableSpacesActivation = DisableSpacesActivation.Value;
modified = true;
}
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity != null)
{
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity.Length > 0)
Expand Down
36 changes: 35 additions & 1 deletion src/Commands/Model/SPOTenant.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.Online.SharePoint.TenantManagement;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Administration;
using Microsoft.SharePoint.Client.Sharing;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -249,7 +250,23 @@ public class SPOTenant
public string[] GuestSharingGroupAllowListInTenantByPrincipalIdentity { private set; get; }
public bool? AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled { private set; get; }
public bool? SelfServiceSiteCreationDisabled { private set; get; }

public string WhoCanShareAllowListInTenant { private set; get; }
public bool ExtendPermissionsToUnprotectedFiles { private set; get; }
public bool LegacyBrowserAuthProtocolsEnabled { private set; get; }
public bool EnableDiscoverableByOrganizationForVideos { private set; get; }
public string RestrictedAccessControlforSitesErrorHelpLink { private set; get; }
public bool Workflow2010Disabled { private set; get; }
public bool AllowSharingOutsideRestrictedAccessControlGroups { private set; get; }
public Workflows2013State Workflows2013State { private set; get; }
public bool DisableVivaConnectionsAnalytics { private set; get; }
public bool HideSyncButtonOnDocLib { private set; get; }
public bool HideSyncButtonOnODB { private set; get; }
public int StreamLaunchConfig { private set; get; }
public bool EnableRestrictedAccessControl { private set; get; }
public SPBlockDownloadFileTypeId[] BlockDownloadFileTypeIds { private set; get; }
public Guid[] ExcludedBlockDownloadGroupIds { private set; get; }
public bool EnableMediaReactions { private set; get; }
public bool ContentSecurityPolicyEnforcement { private set; get; }
#endregion

public SPOTenant(Tenant tenant, ClientContext clientContext)
Expand Down Expand Up @@ -772,6 +789,23 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
try { GuestSharingGroupAllowListInTenantByPrincipalIdentity = tenant.GuestSharingGroupAllowListInTenantByPrincipalIdentity?.ToArray(); } catch { }
try { AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled; } catch { }
try { SelfServiceSiteCreationDisabled = tenant.SelfServiceSiteCreationDisabled; } catch { }
try { WhoCanShareAllowListInTenant = tenant.WhoCanShareAllowListInTenant; } catch { }
try { ExtendPermissionsToUnprotectedFiles = tenant.ExtendPermissionsToUnprotectedFiles; } catch { }
try { LegacyBrowserAuthProtocolsEnabled = tenant.LegacyBrowserAuthProtocolsEnabled; } catch { }
try { EnableDiscoverableByOrganizationForVideos = tenant.EnableDiscoverableByOrganizationForVideos; } catch { }
try { RestrictedAccessControlforSitesErrorHelpLink = tenant.RestrictedAccessControlforSitesErrorHelpLink; } catch { }
try { Workflow2010Disabled = tenant.Workflow2010Disabled; } catch { }
try { Workflows2013State = tenant.Workflows2013State; } catch { }
try { AllowSharingOutsideRestrictedAccessControlGroups = tenant.AllowSharingOutsideRestrictedAccessControlGroups; } catch { }
try { DisableVivaConnectionsAnalytics = tenant.DisableVivaConnectionsAnalytics; } catch { }
try { HideSyncButtonOnDocLib = tenant.HideSyncButtonOnDocLib; } catch { }
try { HideSyncButtonOnODB = tenant.HideSyncButtonOnODB; } catch { }
try { StreamLaunchConfig = tenant.StreamLaunchConfig; } catch { }
try { EnableRestrictedAccessControl = tenant.EnableRestrictedAccessControl; } catch { }
try { BlockDownloadFileTypeIds = tenant.BlockDownloadFileTypeIds; } catch { }
try { ExcludedBlockDownloadGroupIds = tenant.ExcludedBlockDownloadGroupIds; } catch { }
try { EnableMediaReactions = tenant.EnableMediaReactions; } catch { }
try { ContentSecurityPolicyEnforcement = tenant.ContentSecurityPolicyEnforcement; } catch { }
}
}
}
Loading