Skip to content

Commit

Permalink
Merge pull request #4681 from reshmee011/TenantProp
Browse files Browse the repository at this point in the history
Additional properties added to update at tenant level
  • Loading branch information
KoenZomers authored Jan 22, 2025
2 parents a12cf66 + 751fe29 commit 45ff5e5
Show file tree
Hide file tree
Showing 4 changed files with 312 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `Get-PnPFileCheckedOut` cmdlet to retrieve all files that are currently checked out in a library [#4682](https://github.com/pnp/powershell/pull/4682)
- Added `Get-PnPTenantPronounsSetting` and `Set-PnPTenantPronounsSetting` cmdlets to manage the availability of using pronouns in the organization [#4660](https://github.com/pnp/powershell/pull/4660)
- Added `HidePeopleWhoHaveListsOpen` parameter to `Set-PnPSite` cmdlet to hide people who simultaneously have lists open [#4699](https://github.com/pnp/powershell/pull/4699)
- Added `-WhoCanShareAllowListInTenant`, `-LegacyBrowserAuthProtocolsEnabled`, `-EnableDiscoverableByOrganizationForVideos`, `-RestrictedAccessControlforSitesErrorHelpLink`, `-Workflow2010Disabled`, `-AllowSharingOutsideRestrictedAccessControlGroups`, `-HideSyncButtonOnDocLib`, `-HideSyncButtonOnODB`, `-StreamLaunchConfig`, `-EnableMediaReactions`, `-ContentSecurityPolicyEnforcement` and `-DisableSpacesActivation` to `Set-PnPTenant` [#4681](https://github.com/pnp/powershell/pull/4681)

### Changed

Expand Down
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 { }
}
}
}

0 comments on commit 45ff5e5

Please sign in to comment.