Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New graph helper #4617

Merged
merged 38 commits into from
Dec 15, 2024
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
df05c19
Update use of GraphHelper
erwinvanhunen Nov 30, 2024
72506a3
Merge branch 'dev' into NewGraphHelper
erwinvanhunen Nov 30, 2024
ce30688
Renamed GraphHelper to ApiRequestHelper
erwinvanhunen Nov 30, 2024
490d544
Simplified examples
erwinvanhunen Dec 1, 2024
ada8aea
simplified URL
erwinvanhunen Dec 1, 2024
0d38771
renamed file and updated url handling
erwinvanhunen Dec 1, 2024
95ef60e
Nightly publish to PowerShell Gallery
erwinvanhunen Dec 1, 2024
54f55d1
Update to version checker
erwinvanhunen Dec 1, 2024
690dcd2
Rewrote to use tracelog and added Format-PnPTraceLog cmdlet
erwinvanhunen Dec 1, 2024
b564caa
Added automatic login: more work to do
erwinvanhunen Dec 2, 2024
a84f5b2
switched to settings.json
erwinvanhunen Dec 4, 2024
71a26ae
Nightly publish to PowerShell Gallery
erwinvanhunen Dec 2, 2024
9be6e15
Add ExtendPermissionsToUnprotectedFiles parameter to Set-PnPTenant cm…
gautamdsheth Dec 2, 2024
c343145
Nightly publish to PowerShell Gallery
erwinvanhunen Dec 3, 2024
08fc070
Added deprecation notice on the SharePoint Mail API
KoenZomers Dec 3, 2024
fe71fc6
Nightly publish to PowerShell Gallery
erwinvanhunen Dec 4, 2024
e79271e
Added paramset for working with doclibs
KoenZomers Dec 3, 2024
d6f4026
Finalized implementation of Get-PnPFolderItem
KoenZomers Dec 3, 2024
cebed4f
Added same logic to Get-PnPFileInFolder and Get-PnPFolderInFolder as …
KoenZomers Dec 3, 2024
38c32b4
Added changelog entry
KoenZomers Dec 3, 2024
814968f
moved from cachesettings.json to settings.json
erwinvanhunen Dec 4, 2024
22caf50
Updated handling of tracelog
erwinvanhunen Dec 4, 2024
c546ec3
refactored private field name
erwinvanhunen Dec 4, 2024
1c7a97e
Updated tracelogging
erwinvanhunen Dec 4, 2024
caf59bd
renamed file
erwinvanhunen Dec 4, 2024
25bdc3c
Updated tracelogging cmdlets
erwinvanhunen Dec 4, 2024
b2ece1e
Nightly publish to PowerShell Gallery
erwinvanhunen Dec 5, 2024
fec973c
Merge branch 'dev' into NewGraphHelper
erwinvanhunen Dec 5, 2024
1c3f0f6
removed unneeded include
erwinvanhunen Dec 5, 2024
0f1f542
Removed unused usings
erwinvanhunen Dec 5, 2024
f484329
Fixed using
erwinvanhunen Dec 5, 2024
d77554e
Changed warning message
erwinvanhunen Dec 5, 2024
49b1166
Updated cleaning
erwinvanhunen Dec 5, 2024
8ce27d5
Merge branch 'dev' into NewGraphHelper
erwinvanhunen Dec 9, 2024
986269c
Updated cache enabled message
erwinvanhunen Dec 9, 2024
a686e91
Fixed JSON escaping in log message
erwinvanhunen Dec 9, 2024
3e19244
Merge branch 'dev' into NewGraphHelper
gautamdsheth Dec 15, 2024
006dea3
Merge branch 'dev' into NewGraphHelper
gautamdsheth Dec 15, 2024
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
Prev Previous commit
Next Next commit
Add ExtendPermissionsToUnprotectedFiles parameter to Set-PnPTenant cm…
…dlet (#4602)

Co-authored-by: Gautam Sheth <gautam.sheth@staffbase.com>
  • Loading branch information
2 people authored and erwinvanhunen committed Dec 5, 2024
commit 9be6e15a9a675c40e6c5de46d57b8d13d879a993
15 changes: 15 additions & 0 deletions documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
@@ -163,6 +163,7 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
[-AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled <Boolean>]
[-SelfServiceSiteCreationDisabled <Boolean>]
[-SyncAadB2BManagementPolicy]
[-ExtendPermissionsToUnprotectedFiles <Boolean>]
[-Force] [-Connection <PnPConnection>]
```

@@ -2860,6 +2861,20 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -ExtendPermissionsToUnprotectedFiles
This property can be used to turn on/off the capability called "Extended SharePoint permissions to unprotected files". To learn more about this feature check [here](https://learn.microsoft.com/en-us/purview/sensitivity-labels-sharepoint-extend-permissions)

```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

29 changes: 19 additions & 10 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.Online.SharePoint.TenantManagement;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Administration;
using Microsoft.SharePoint.Client.Sharing;
using PnP.PowerShell.Commands.Base;
using System.Management.Automation;
using System;
using Microsoft.Online.SharePoint.TenantManagement;
using System.Collections.Generic;
using Microsoft.SharePoint.Client.Sharing;
using Microsoft.SharePoint.Client.Administration;
using System.Linq;
using System.Management.Automation;
using InformationBarriersMode = PnP.PowerShell.Commands.Enums.InformationBarriersMode;

namespace PnP.PowerShell.Commands.Admin
@@ -473,10 +473,10 @@ public class SetTenant : PnPAdminCmdlet

[Parameter(Mandatory = false)]
public Role? CoreDefaultShareLinkRole { private set; get; }

[Parameter(Mandatory = false)]
public SharingCapabilities? OneDriveSharingCapability { private set; get; }

[Parameter(Mandatory = false)]
public string[] GuestSharingGroupAllowListInTenantByPrincipalIdentity { private set; get; }

@@ -488,7 +488,11 @@ public class SetTenant : PnPAdminCmdlet

[Parameter(Mandatory = false)]
public SwitchParameter SyncAadB2BManagementPolicy { private set; get; }


[Parameter(Mandatory = false)]
public bool? ExtendPermissionsToUnprotectedFiles { private set; get; }


protected override void ExecuteCmdlet()
{
AdminContext.Load(Tenant);
@@ -1543,12 +1547,12 @@ protected override void ExecuteCmdlet()
Tenant.CoreDefaultShareLinkRole = CoreDefaultShareLinkRole.Value;
modified = true;
}
if(OneDriveSharingCapability.HasValue)
if (OneDriveSharingCapability.HasValue)
{
Tenant.ODBSharingCapability = OneDriveSharingCapability.Value;
modified = true;
}
if(AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.HasValue)
if (AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.HasValue)
{
Tenant.AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled = AllowWebPropertyBagUpdateWhenDenyAddAndCustomizePagesIsEnabled.Value;
modified = true;
@@ -1563,7 +1567,12 @@ protected override void ExecuteCmdlet()
Tenant.SyncAadB2BManagementPolicy();
modified = true;
}
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity !=null)
if (ExtendPermissionsToUnprotectedFiles.HasValue)
{
Tenant.ExtendPermissionsToUnprotectedFiles = ExtendPermissionsToUnprotectedFiles.Value;
modified = true;
}
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity != null)
{
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity.Length > 0)
{