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
30 changes: 30 additions & 0 deletions documentation/Set-PnPSite.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ Set-PnPSite
[-ScriptSafeDomainName <string>]
[-BlockDownloadPolicy <Boolean>] [-ExcludeBlockDownloadPolicySiteOwners <Boolean>]
[-ExcludedBlockDownloadGroupIds <Guid[]>]
[-ExcludeBlockDownloadSharePointGroups <String[]>]
[-ReadOnlyForBlockDownloadPolicy]
[-ListsShowHeaderAndNavigation <Boolean>]
[-RestrictContentOrgWideSearch <Boolean>]
[-CanSyncHubSitePermissions <SwitchParameter>]
Expand Down Expand Up @@ -635,6 +637,34 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ExcludeBlockDownloadSharePointGroups
Exempts users from the specified SharePoint groups from the block download policy. Users in these groups can fully download any content for the site.

```yaml
Type: String[]
Parameter Sets: Set Properties

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

### -ReadOnlyForBlockDownloadPolicy
When enabled in combination with BlockDownloadPolicy, users will only be able to view the content in read-only mode but will not be able to download or sync files.

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

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

### -ListsShowHeaderAndNavigation
Set a property on a site collection to make all lists always load with the site elements intact.

Expand Down
30 changes: 30 additions & 0 deletions documentation/Set-PnPTenantSite.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Set-PnPTenantSite [-Identity] <String> [-Title <String>] [-LocaleId <UInt32>] [-
[-MediaTranscription <MediaTranscriptionPolicyType>]
[-BlockDownloadPolicy <Boolean>] [-ExcludeBlockDownloadPolicySiteOwners <Boolean>]
[-ExcludedBlockDownloadGroupIds <Guid[]>]
[-ExcludeBlockDownloadSharePointGroups <String[]>]
[-ReadOnlyForBlockDownloadPolicy]
[-ListsShowHeaderAndNavigation <Boolean>]
[-DefaultLinkToExistingAccessReset <SwitchParameter>] [-DefaultShareLinkRole <Role>]
[-DefaultShareLinkScope <SharingScope>] [-LoopDefaultSharingLinkRole <Role>]
Expand Down Expand Up @@ -744,6 +746,34 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ExcludeBlockDownloadSharePointGroups
Exempts users from the specified SharePoint groups from the block download policy. Users in these groups can fully download any content for the site.

```yaml
Type: String[]
Parameter Sets: Set Properties

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

### -ReadOnlyForBlockDownloadPolicy
When enabled in combination with BlockDownloadPolicy, users will only be able to view the content in read-only mode but will not be able to download or sync files.

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

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

### -ListsShowHeaderAndNavigation
Set a property on a site collection to make all lists always load with the site elements intact.

Expand Down
20 changes: 19 additions & 1 deletion src/Commands/Admin/SetTenantSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,13 @@ public class SetTenantSite : PnPSharePointOnlineAdminCmdlet

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


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

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public SwitchParameter ReadOnlyForBlockDownloadPolicy;

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

Expand Down Expand Up @@ -677,6 +683,18 @@ private void SetSiteProperties(Func<TenantOperationMessage, bool> timeoutFunctio
updateRequired = true;
}

if (ParameterSpecified(nameof(ExcludeBlockDownloadSharePointGroups)) && ExcludeBlockDownloadSharePointGroups.Length > 0)
{
props.ExcludeBlockDownloadSharePointGroups = ExcludeBlockDownloadSharePointGroups;
updateRequired = true;
}

if (ParameterSpecified(nameof(ReadOnlyForBlockDownloadPolicy)) && ReadOnlyForBlockDownloadPolicy.IsPresent)
{
props.ReadOnlyForBlockDownloadPolicy = ReadOnlyForBlockDownloadPolicy.ToBool();
updateRequired = true;
}

if (updateRequired)
{
var op = props.Update();
Expand Down
22 changes: 21 additions & 1 deletion src/Commands/Site/SetSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ public class SetSite : PnPSharePointCmdlet
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public SwitchParameter? CanSyncHubSitePermissions;

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

[Parameter(Mandatory = false, ParameterSetName = ParameterSet_PROPERTIES)]
public SwitchParameter ReadOnlyForBlockDownloadPolicy;

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

Expand Down Expand Up @@ -440,6 +446,18 @@ protected override void ExecuteCmdlet()
executeQueryRequired = true;
}

if (ParameterSpecified(nameof(ExcludeBlockDownloadSharePointGroups)) && ExcludeBlockDownloadSharePointGroups.Length > 0)
{
siteProperties.ExcludeBlockDownloadSharePointGroups = ExcludeBlockDownloadSharePointGroups;
executeQueryRequired = true;
}

if (ParameterSpecified(nameof(ReadOnlyForBlockDownloadPolicy)) && ReadOnlyForBlockDownloadPolicy.IsPresent)
{
siteProperties.ReadOnlyForBlockDownloadPolicy = ReadOnlyForBlockDownloadPolicy.ToBool();
executeQueryRequired = true;
}

if (executeQueryRequired)
{
siteProperties.Update();
Expand Down Expand Up @@ -497,6 +515,8 @@ private bool IsTenantProperty() =>
ParameterSpecified(nameof(ExcludedBlockDownloadGroupIds)) ||
ListsShowHeaderAndNavigation.HasValue ||
HidePeoplePreviewingFiles.HasValue ||
HidePeopleWhoHaveListsOpen.HasValue;
HidePeopleWhoHaveListsOpen.HasValue ||
ParameterSpecified(nameof(ExcludeBlockDownloadSharePointGroups)) ||
ReadOnlyForBlockDownloadPolicy.IsPresent;
}
}
Loading