Skip to content

Commit

Permalink
Merge pull request #2719 from KoenZomers/ReceiveFilesInSPO
Browse files Browse the repository at this point in the history
Added properties for the new receive files in SharePoint Site folder feature
  • Loading branch information
gautamdsheth committed Jan 12, 2023
2 parents 4dd0d46 + 55b8ea5 commit 962f178
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `ResponseHeadersVariable` parameter to the `Invoke-PnPSPRestMethod` which if specified will store the response headers values in the PowerShell variable name that is specified. [#2711](https://github.com/pnp/powershell/pull/2711)
- Added `-Filter` parameter to `Get-PnPAzureADServicePrincipal` cmdlet to retrieve specific application registrations based on filter conditions. It supports simple and advanced queries. [#2710](https://github.com/pnp/powershell/pull/2710)
- Added `-Filter` parameter to `Get-PnPMicrosoft365Group` cmdlet to retrieve specific M365 groups based on filter conditions. It supports simple and advanced queries.
- Added `-CoreRequestFilesLinkExpirationInDays` and `-CoreRequestFilesLinkEnabled` to `Set-PnPTenant` and `-RequestFilesLinkExpirationInDays` to `Set-PnPSite` to allow configuration of the new receive files to SharePoint Online folder feature [#2719](https://github.com/pnp/powershell/pull/2719)

### Changed

Expand Down
55 changes: 45 additions & 10 deletions documentation/Set-PnPSite.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,35 @@ Sets site collection properties.

### Set Properties
```powershell
Set-PnPSite [-Identity <String>] [-Classification <String>] [-DisableFlows] [-LogoFilePath <String>]
[-Sharing <SharingCapabilities>] [-StorageMaximumLevel <Int64>] [-StorageWarningLevel <Int64>]
[-AllowSelfServiceUpgrade] [-NoScriptSite] [-Owners <System.Collections.Generic.List`1[System.String]>]
[-CommentsOnSitePagesDisabled] [-DefaultLinkPermission <SharingPermissionType>]
[-DefaultSharingLinkType <SharingLinkType>] [-DefaultLinkToExistingAccess <Boolean>] [-DefaultLinkToExistingAccessReset] [-DisableAppViews <AppViewsPolicy>]
[-DisableCompanyWideSharingLinks <CompanyWideSharingLinksPolicy>] [-DisableSharingForNonOwners]
[-LocaleId <UInt32>] [-RestrictedToGeo <RestrictedToRegion>] [-SocialBarOnSitePagesDisabled]
[-AnonymousLinkExpirationInDays <Int32>] [-OverrideTenantAnonymousLinkExpirationPolicy]
[-MediaTranscription <MediaTranscriptionPolicyType>] [-SensitivityLabel <Guid>] [-RequestFilesLinkEnabled <Boolean>] [-ScriptSafeDomainName <string>]
[-Connection <PnPConnection>] [<CommonParameters>]
Set-PnPSite [-Identity <String>]
[-Classification <String>]
[-DisableFlows]
[-LogoFilePath <String>]
[-Sharing <SharingCapabilities>]
[-StorageMaximumLevel <Int64>]
[-StorageWarningLevel <Int64>]
[-AllowSelfServiceUpgrade]
[-NoScriptSite]
[-Owners <System.Collections.Generic.List<[System.String]>]
[-CommentsOnSitePagesDisabled]
[-DefaultLinkPermission <SharingPermissionType>]
[-DefaultSharingLinkType <SharingLinkType>]
[-DefaultLinkToExistingAccess <Boolean>]
[-DefaultLinkToExistingAccessReset]
[-DisableAppViews <AppViewsPolicy>]
[-DisableCompanyWideSharingLinks <CompanyWideSharingLinksPolicy>]
[-DisableSharingForNonOwners]
[-LocaleId <UInt32>]
[-RestrictedToGeo <RestrictedToRegion>]
[-SocialBarOnSitePagesDisabled]
[-AnonymousLinkExpirationInDays <Int32>]
[-RequestFilesLinkExpirationInDays <Int32>]
[-OverrideTenantAnonymousLinkExpirationPolicy]
[-MediaTranscription <MediaTranscriptionPolicyType>]
[-SensitivityLabel <Guid>]
[-RequestFilesLinkEnabled <Boolean>]
[-ScriptSafeDomainName <string>]
[-Connection <PnPConnection>]
```

### Set Lock State
Expand Down Expand Up @@ -113,6 +132,22 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -RequestFilesLinkExpirationInDays
Specifies the number of days before a Request Files link expires for the site.

The value can be from 0 to 730 days.

```yaml
Type: Int32
Parameter Sets: Set Properties

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

### -Classification
The classification tag to set. This is the old classification/labeling method. Set it to $null to remove the classification entirely.

Expand Down
47 changes: 47 additions & 0 deletions documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
[-EnableRestrictedAccessControl <Boolean>]
[-SyncAadB2BManagementPolicy <Boolean>]
[-EnableAzureADB2BIntegration <Boolean>]
[-CoreRequestFilesLinkEnabled <Boolean>]
[-CoreRequestFilesLinkExpirationInDays <Boolean>]
[-LabelMismatchEmailHelpLink <String>]
[-Force] [-Connection <PnPConnection>]
```

Expand Down Expand Up @@ -1503,6 +1506,50 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -CoreRequestFilesLinkEnabled
Enable or disable the Request files link on the core partition for all SharePoint sites (not including OneDrive sites). If this value is not set, Request files will only show for OneDrives with Anyone links enabled.

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

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

### -CoreRequestFilesLinkExpirationInDays
Specifies the number of days before a Request files link expires for all SharePoint sites (not including OneDrive sites).

The value can be from 0 to 730 days.

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

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

### -LabelMismatchEmailHelpLink
This parameter allows tenant admins to customize the "Help Link" in email with the subject "Incompatible sensitivity label detected." When a sensitivity label mismatch occurs between the label on the document uploaded and the label on the site, SharePoint Online captures an audit record and sends an Incompatible sensitivity label detected email notification to the person who uploaded the document and the site owner. The notification contains details of the document which caused the problem and the label assigned to the document and to the site. The comparison happens between the priority of these two labels.

```yaml
Type: String
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
33 changes: 32 additions & 1 deletion src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Set, "PnPTenant", DefaultParameterSetName = ParameterAttribute.AllParameterSets)]

public class SetTenant : PnPAdminCmdlet
{
[Parameter(Mandatory = false, ParameterSetName = ParameterAttribute.AllParameterSets)]
Expand Down Expand Up @@ -271,6 +270,15 @@ public class SetTenant : PnPAdminCmdlet
[Parameter(Mandatory = false)]
public bool? SyncAadB2BManagementPolicy;

[Parameter(Mandatory = false)]
public bool? CoreRequestFilesLinkEnabled;

[Parameter(Mandatory = false)]
public int? CoreRequestFilesLinkExpirationInDays;

[Parameter(Mandatory = false)]
public string LabelMismatchEmailHelpLink;

[Parameter(Mandatory = false)]
public SwitchParameter Force;

Expand Down Expand Up @@ -981,6 +989,29 @@ protected override void ExecuteCmdlet()
modified = true;
}

if (CoreRequestFilesLinkEnabled.HasValue)
{
Tenant.CoreRequestFilesLinkEnabled = CoreRequestFilesLinkEnabled.Value;
modified = true;
}

if (CoreRequestFilesLinkExpirationInDays.HasValue)
{
if (CoreRequestFilesLinkExpirationInDays.Value < 0 || CoreRequestFilesLinkExpirationInDays > 730)
{
throw new PSArgumentException($"{CoreRequestFilesLinkExpirationInDays} must have a value between 0 and 730", nameof(CoreRequestFilesLinkExpirationInDays));
}

Tenant.CoreRequestFilesLinkExpirationInDays = CoreRequestFilesLinkExpirationInDays.Value;
modified = true;
}

if (LabelMismatchEmailHelpLink != null)
{
Tenant.LabelMismatchEmailHelpLink = LabelMismatchEmailHelpLink;
modified = true;
}

if (modified)
{
ClientContext.ExecuteQueryRetry();
Expand Down
15 changes: 15 additions & 0 deletions src/Commands/Site/SetSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ public class SetSite : PnPSharePointCmdlet
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public bool? RequestFilesLinkEnabled;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public int? RequestFilesLinkExpirationInDays;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public string ScriptSafeDomainName;

Expand Down Expand Up @@ -331,6 +334,18 @@ protected override void ExecuteCmdlet()
siteProperties.RequestFilesLinkEnabled = RequestFilesLinkEnabled.Value;
executeQueryRequired = true;
}

if (RequestFilesLinkExpirationInDays.HasValue)
{
if (RequestFilesLinkExpirationInDays.Value < 0 || RequestFilesLinkExpirationInDays > 730)
{
throw new PSArgumentException($"{RequestFilesLinkExpirationInDays} must have a value between 0 and 730", nameof(RequestFilesLinkExpirationInDays));
}

siteProperties.RequestFilesLinkExpirationInDays = RequestFilesLinkExpirationInDays.Value;
executeQueryRequired = true;
}

if (ParameterSpecified(nameof(RestrictedAccessControl)) && RestrictedAccessControl.HasValue)
{
siteProperties.RestrictedAccessControl = RestrictedAccessControl.Value;
Expand Down

0 comments on commit 962f178

Please sign in to comment.