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
15 changes: 15 additions & 0 deletions documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
[-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled <Boolean>]
[-SelfServiceSiteCreationDisabled <Boolean>]
[-SyncAadB2BManagementPolicy]
[-ExtendPermissionsToUnprotectedFiles <Boolean>]
[-Force] [-Connection <PnPConnection>]
```

Expand Down Expand Up @@ -2860,6 +2861,20 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ExtendPermissionsToUnprotectedFiles
This property can be used to turn on/off the capability called "Extended SharePoint permissions to unprotected files". To learn more about this feature check [here](https://learn.microsoft.com/en-us/purview/sensitivity-labels-sharepoint-extend-permissions)

```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
29 changes: 19 additions & 10 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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 PnP.PowerShell.Commands.Base;
using System.Management.Automation;
using System;
using Microsoft.Online.SharePoint.TenantManagement;
using System.Collections.Generic;
using Microsoft.SharePoint.Client.Sharing;
using Microsoft.SharePoint.Client.Administration;
using System.Linq;
using System.Management.Automation;
using InformationBarriersMode = PnP.PowerShell.Commands.Enums.InformationBarriersMode;

namespace PnP.PowerShell.Commands.Admin
Expand Down Expand Up @@ -473,10 +473,10 @@ public class SetTenant : PnPAdminCmdlet

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

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

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

Expand All @@ -488,7 +488,11 @@ public class SetTenant : PnPAdminCmdlet

[Parameter(Mandatory = false)]
public SwitchParameter SyncAadB2BManagementPolicy { private set; get; }


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


protected override void ExecuteCmdlet()
{
AdminContext.Load(Tenant);
Expand Down Expand Up @@ -1543,12 +1547,12 @@ protected override void ExecuteCmdlet()
Tenant.CoreDefaultShareLinkRole = CoreDefaultShareLinkRole.Value;
modified = true;
}
if(OneDriveSharingCapability.HasValue)
if (OneDriveSharingCapability.HasValue)
{
Tenant.ODBSharingCapability = OneDriveSharingCapability.Value;
modified = true;
}
if(AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.HasValue)
if (AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.HasValue)
{
Tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.Value;
modified = true;
Expand All @@ -1563,7 +1567,12 @@ protected override void ExecuteCmdlet()
Tenant.SyncAadB2BManagementPolicy();
modified = true;
}
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity !=null)
if (ExtendPermissionsToUnprotectedFiles.HasValue)
{
Tenant.ExtendPermissionsToUnprotectedFiles = ExtendPermissionsToUnprotectedFiles.Value;
modified = true;
}
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity != null)
{
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity.Length > 0)
{
Expand Down
Loading