diff --git a/CHANGELOG.md b/CHANGELOG.md index d67b9f16c..f60ee1b2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/documentation/Set-PnPSite.md b/documentation/Set-PnPSite.md index 29eba7ecb..c4ed44437 100644 --- a/documentation/Set-PnPSite.md +++ b/documentation/Set-PnPSite.md @@ -16,16 +16,35 @@ Sets site collection properties. ### Set Properties ```powershell -Set-PnPSite [-Identity ] [-Classification ] [-DisableFlows] [-LogoFilePath ] - [-Sharing ] [-StorageMaximumLevel ] [-StorageWarningLevel ] - [-AllowSelfServiceUpgrade] [-NoScriptSite] [-Owners ] - [-CommentsOnSitePagesDisabled] [-DefaultLinkPermission ] - [-DefaultSharingLinkType ] [-DefaultLinkToExistingAccess ] [-DefaultLinkToExistingAccessReset] [-DisableAppViews ] - [-DisableCompanyWideSharingLinks ] [-DisableSharingForNonOwners] - [-LocaleId ] [-RestrictedToGeo ] [-SocialBarOnSitePagesDisabled] - [-AnonymousLinkExpirationInDays ] [-OverrideTenantAnonymousLinkExpirationPolicy] - [-MediaTranscription ] [-SensitivityLabel ] [-RequestFilesLinkEnabled ] [-ScriptSafeDomainName ] - [-Connection ] [] +Set-PnPSite [-Identity ] +[-Classification ] +[-DisableFlows] +[-LogoFilePath ] + [-Sharing ] + [-StorageMaximumLevel ] + [-StorageWarningLevel ] + [-AllowSelfServiceUpgrade] + [-NoScriptSite] + [-Owners ] + [-CommentsOnSitePagesDisabled] + [-DefaultLinkPermission ] + [-DefaultSharingLinkType ] + [-DefaultLinkToExistingAccess ] + [-DefaultLinkToExistingAccessReset] + [-DisableAppViews ] + [-DisableCompanyWideSharingLinks ] + [-DisableSharingForNonOwners] + [-LocaleId ] + [-RestrictedToGeo ] + [-SocialBarOnSitePagesDisabled] + [-AnonymousLinkExpirationInDays ] + [-RequestFilesLinkExpirationInDays ] + [-OverrideTenantAnonymousLinkExpirationPolicy] + [-MediaTranscription ] + [-SensitivityLabel ] + [-RequestFilesLinkEnabled ] + [-ScriptSafeDomainName ] + [-Connection ] ``` ### Set Lock State @@ -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. diff --git a/documentation/Set-PnPTenant.md b/documentation/Set-PnPTenant.md index 4f8139b2d..d567d9e98 100644 --- a/documentation/Set-PnPTenant.md +++ b/documentation/Set-PnPTenant.md @@ -94,6 +94,9 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames [-EnableRestrictedAccessControl ] [-SyncAadB2BManagementPolicy ] [-EnableAzureADB2BIntegration ] + [-CoreRequestFilesLinkEnabled ] + [-CoreRequestFilesLinkExpirationInDays ] + [-LabelMismatchEmailHelpLink ] [-Force] [-Connection ] ``` @@ -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 diff --git a/src/Commands/Admin/SetTenant.cs b/src/Commands/Admin/SetTenant.cs index 82be1d0c0..4048ffd86 100644 --- a/src/Commands/Admin/SetTenant.cs +++ b/src/Commands/Admin/SetTenant.cs @@ -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)] @@ -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; @@ -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(); diff --git a/src/Commands/Site/SetSite.cs b/src/Commands/Site/SetSite.cs index 316d0a09f..77d9e1fdb 100644 --- a/src/Commands/Site/SetSite.cs +++ b/src/Commands/Site/SetSite.cs @@ -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; @@ -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;