Skip to content

Commit

Permalink
Added OneDriveRequestFilesLinkEnabled option to Set-PnPTenant and Req…
Browse files Browse the repository at this point in the history
…uestFilesLinkEnabled to Set-PnPSite (#2360)

* Added AddOneDriveRequestFilesLinkEnabled option to Set-PnPTenant

* Adding PR reference

* Adding to documentation

* Adding option to Set-PnPSite

* Updated changelog with Set-PnPSite option

* Fixing build error

* Fixing paramset issue

* Fixing build issue
  • Loading branch information
KoenZomers authored Sep 20, 2022
1 parent e9786d0 commit 5485e8d
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added ability to create shared Teams channels using `Add-PnPTeamsChannel -ChannelType Shared` [#2308](https://github.com/pnp/powershell/pull/2308)
- Added support for `IsLoopEnabled` properties in `Get-PnPTenant` and `Set-PnPTenant` cmdlets to to enable/disable loop components in the tenant. [#2307](https://github.com/pnp/powershell/pull/2307)
- Added support for `SubscribeMembersToCalendarEventsDisabled` resource behavior option in `New-PnPMicrosoft365Group` and `New-PnPTeamsTeam` cmdlet. [#2349](https://github.com/pnp/powershell/pull/2349)
- Added `-OneDriveRequestFilesLinkEnabled` option to `Set-PnPTenant` to allow configuring the request files anonymously feature on the tenant level [#2360](https://github.com/pnp/powershell/pull/2360)
- Added `-RequestFilesLinkEnabled` option to `Set-PnPSite` to allow configuring the request files anonymously feature on a per site collection level [#2360](https://github.com/pnp/powershell/pull/2360)

### Changed
- Changed to no longer require `https://` to be prefixed when using `Connect-PnPOnline -Url tenant.sharepoint.com` [#2139](https://github.com/pnp/powershell/pull/2139)
Expand Down
16 changes: 15 additions & 1 deletion documentation/Set-PnPSite.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Set-PnPSite [-Identity <String>] [-Classification <String>] [-DisableFlows] [-Lo
[-DisableCompanyWideSharingLinks <CompanyWideSharingLinksPolicy>] [-DisableSharingForNonOwners]
[-LocaleId <UInt32>] [-RestrictedToGeo <RestrictedToRegion>] [-SocialBarOnSitePagesDisabled]
[-AnonymousLinkExpirationInDays <Int32>] [-OverrideTenantAnonymousLinkExpirationPolicy]
[-MediaTranscription <MediaTranscriptionPolicyType>] [-SensitivityLabel <Guid>]
[-MediaTranscription <MediaTranscriptionPolicyType>] [-SensitivityLabel <Guid>] [-RequestFilesLinkEnabled <Boolean>]
[-Connection <PnPConnection>] [<CommonParameters>]
```

Expand Down Expand Up @@ -456,6 +456,20 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -RequestFilesLinkEnabled
Allows configuring whether users will be able to create anonymous requests for people to upload files regardless of the Share with anyone link configuration setting for this particular site collection.
```yaml
Type: Boolean
Parameter Sets: (All)

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Wait
Wait for the operation to complete
Expand Down
16 changes: 15 additions & 1 deletion documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
[-EnableAutoNewsDigest <Boolean>] [-CommentsOnListItemsDisabled <Boolean>] [-CommentsOnFilesDisabled <Boolean>]
[-DisableBackToClassic <Boolean>] [-InformationBarriersSuspension <Boolean>]
[-AllowFilesWithKeepLabelToBeDeletedODB <Boolean>] [-AllowFilesWithKeepLabelToBeDeletedSPO <Boolean>]
[-ExternalUserExpirationRequired <Boolean>] [-ExternalUserExpireInDays <Boolean>]
[-ExternalUserExpirationRequired <Boolean>] [-ExternalUserExpireInDays <Boolean>] [-OneDriveRequestFilesLinkEnabled <Boolean>]
[-Force] [-Connection <PnPConnection>] [<CommonParameters>]
```

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

### -OneDriveRequestFilesLinkEnabled
Allows configuring whether users will be able to create anonymous requests for people to upload files regardless of the Share with anyone link configuration setting.

```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
12 changes: 10 additions & 2 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;

using PnP.PowerShell.Commands.Base;
using System.Management.Automation;
using System;
Expand Down Expand Up @@ -260,6 +259,9 @@ public class SetTenant : PnPAdminCmdlet
[Parameter(Mandatory = false)]
public bool? IsLoopEnabled;

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

public SwitchParameter Force;

protected override void ExecuteCmdlet()
Expand Down Expand Up @@ -943,7 +945,13 @@ protected override void ExecuteCmdlet()
{
Tenant.IsLoopEnabled = IsLoopEnabled.Value;
modified = true;
}
}

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

if (modified)
{
Expand Down
10 changes: 9 additions & 1 deletion src/Commands/Site/SetSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public class SetSite : PnPSharePointCmdlet
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public Guid? SensitivityLabel;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public bool? RequestFilesLinkEnabled;

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_LOCKSTATE)]
public SwitchParameter Wait;

Expand Down Expand Up @@ -306,7 +309,12 @@ protected override void ExecuteCmdlet()
siteProperties.MediaTranscription = MediaTranscription.Value;
executeQueryRequired = true;
}


if (RequestFilesLinkEnabled.HasValue)
{
siteProperties.RequestFilesLinkEnabled = RequestFilesLinkEnabled.Value;
executeQueryRequired = true;
}
if (executeQueryRequired)
{
siteProperties.Update();
Expand Down

0 comments on commit 5485e8d

Please sign in to comment.