From 4efbca1f222a9df48d11ac8e499a3517d619b5f7 Mon Sep 17 00:00:00 2001 From: reshmee011 Date: Sun, 25 Aug 2024 14:06:44 +0100 Subject: [PATCH] add additonal properties RequestFilesLinkExpirationInDays,RequestFilesLinkEnabled and OverrideSharingCapability --- documentation/Set-PnPTenantSite.md | 49 ++++++++++++++++++++++++++++- src/Commands/Admin/SetTenantSite.cs | 27 ++++++++++++++++ src/Commands/Model/SPOSite.cs | 4 +++ 3 files changed, 79 insertions(+), 1 deletion(-) diff --git a/documentation/Set-PnPTenantSite.md b/documentation/Set-PnPTenantSite.md index 8ee4822bf..d819a825a 100644 --- a/documentation/Set-PnPTenantSite.md +++ b/documentation/Set-PnPTenantSite.md @@ -40,7 +40,9 @@ Set-PnPTenantSite [-Identity] [-Title ] [-LocaleId ] [- [-DefaultLinkToExistingAccessReset ] [-DefaultShareLinkRole ] [-DefaultShareLinkScope ] [-LoopDefaultSharingLinkRole ] [-LoopDefaultSharingLinkScope ] [-RestrictContentOrgWideSearch ] [-ReadOnlyForUnmanagedDevices ] - [-InheritVersionPolicyFromTenant ] + [-RequestFilesLinkExpirationInDays ] [-RequestFilesLinkEnabled ] [-OverrideSharingCapability ] + [-RestrictedAccessControl ] [-ClearRestrictedAccessControl ] [-RestrictedAccessControlGroups ] + [-AddRestrictedAccessControlGroups ] [-RemoveRestrictedAccessControlGroups ][-InheritVersionPolicyFromTenant ] [-Wait] [-Connection ] ``` @@ -940,6 +942,51 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -RequestFilesLinkExpirationInDays +Specifies the number of days after which the request files link will expire. +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 +``` + + +### -OverrideSharingCapability +Specifies whether to override the sharing capability for the site. + +```yaml +Type: Boolean +Parameter Sets: Set Properties + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestFilesLinkEnabled +Enables or disables the Request Files link on the site. + +```yaml +Type: Boolean +Parameter Sets: Set Properties + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + + ### -Wait Wait for the operation to complete diff --git a/src/Commands/Admin/SetTenantSite.cs b/src/Commands/Admin/SetTenantSite.cs index a88c9a067..17295ba43 100644 --- a/src/Commands/Admin/SetTenantSite.cs +++ b/src/Commands/Admin/SetTenantSite.cs @@ -214,6 +214,15 @@ public class SetTenantSite : PnPAdminCmdlet [Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)] public SwitchParameter InheritVersionPolicyFromTenant; + [Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)] + public bool OverrideSharingCapability; + + [Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)] + public int RequestFilesLinkExpirationInDays; + + [Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)] + public bool RequestFilesLinkEnabled; + [Parameter(Mandatory = false)] public SwitchParameter Wait; @@ -641,6 +650,24 @@ private void SetSiteProperties(Func timeoutFunctio updateRequired = true; } + if (ParameterSpecified(nameof(OverrideSharingCapability))) + { + props.ReadOnlyForUnmanagedDevices = OverrideSharingCapability; + updateRequired = true; + } + + if (ParameterSpecified(nameof(RequestFilesLinkExpirationInDays))) + { + props.RequestFilesLinkExpirationInDays = RequestFilesLinkExpirationInDays; + updateRequired = true; + } + + if (ParameterSpecified(nameof(RequestFilesLinkEnabled))) + { + props.RequestFilesLinkEnabled = RequestFilesLinkEnabled; + updateRequired = true; + } + if (updateRequired) { var op = props.Update(); diff --git a/src/Commands/Model/SPOSite.cs b/src/Commands/Model/SPOSite.cs index a400de790..234e9ce41 100644 --- a/src/Commands/Model/SPOSite.cs +++ b/src/Commands/Model/SPOSite.cs @@ -100,6 +100,9 @@ public class SPOSite public bool SetOwnerWithoutUpdatingSecondaryAdmin { get; set; } public bool RestrictContentOrgWideSearch { get; set; } public bool ReadOnlyForUnmanagedDevices { get; set; } + public SiteUserInfoVisibilityPolicyValue OverrideBlockUserInfoVisibility { get; set; } + public bool OverrideSharingCapability { get; set; } + #endregion @@ -192,6 +195,7 @@ public SPOSite(SiteProperties props, bool? disableSharingForNonOwnersStatus) SetOwnerWithoutUpdatingSecondaryAdmin = props.SetOwnerWithoutUpdatingSecondaryAdmin; RestrictContentOrgWideSearch = props.RestrictContentOrgWideSearch; ReadOnlyForUnmanagedDevices = props.ReadOnlyForUnmanagedDevices; + OverrideSharingCapability = props.OverrideSharingCapability; } } } \ No newline at end of file