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
12 changes: 10 additions & 2 deletions documentation/Get-PnPFileSharingLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: Get-PnPFileSharingLink
# Get-PnPFileSharingLink

## SYNOPSIS
Retrieves sharing links to associated with the file.
Retrieves sharing links to associated with the file or list item.

## SYNTAX

Expand All @@ -20,7 +20,7 @@ Get-PnPFileSharingLink -Identity <FilePipeBind> [-Verbose] [-Connection <PnPConn

## DESCRIPTION

Retrieves sharing links for a file.
Retrieves sharing links for a file or list item.

## EXAMPLES

Expand All @@ -46,6 +46,7 @@ Get-PnPListItem -List "Documents" | Get-PnPFileSharingLink
This will fetch sharing links for all files in the `Documents` library.

### EXAMPLE 4

```powershell
Get-PnPListItem -List "Documents" -Id 1 | Get-PnPFileSharingLink
```
Expand Down Expand Up @@ -73,6 +74,13 @@ Get-PnPFileInFolder -Recurse -ExcludeSystemFolders -FolderSiteRelativeUrl "Share

This will fetch sharing links for all files in the `Shared Documents` library, including the files in subfolders, excluding the ones in hidden internal system folders where no expiration has been set on the sharing of the file.

### EXAMPLE 8
```powershell
Get-PnPFileSharingLink -Identity /sites/demo/Lists/Issue tracker/1_.000
```

This will fetch sharing links for the list item with id `1` from list `Issue Tracker`

## PARAMETERS

### -Connection
Expand Down
89 changes: 79 additions & 10 deletions documentation/Set-PnPTenant.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ Set-PnPTenant [-SpecialCharactersStateInFileFolderNames <SpecialCharactersState>
[-IsSharePointAddInsDisabled <Boolean>]
[-CoreDefaultShareLinkScope <SharingScope>]
[-CoreDefaultShareLinkRole <Role>]
[-GuestSharingGroupAllowListInTenantByPrincipalIdentity <string[]>]
[-OneDriveSharingCapability <SharingCapabilities>]
[-Force] [-Connection <PnPConnection>]
```

Expand Down Expand Up @@ -196,6 +198,20 @@ Set-PnPTenant -UsePersistentCookiesForExplorerView $true

This example enables the use of special persisted cookie for Open with Explorer.

### EXAMPLE 5
```powershell
Set-PnPTenant -GuestSharingGroupAllowListInTenantByPrincipalIdentity {c:0o.c|federateddirectoryclaimprovider|ee0f40fc-b2f7-45c7-b62d-11b90dd2ea8e}
```

This example sets the guest sharing group allow list in the tenant to the specified principal identity.

### EXAMPLE 6
```powershell
Set-PnPTenant -GuestSharingGroupAllowListInTenantByPrincipalIdentity {}
```

This example clears the guest sharing group allow list in the tenant.

## PARAMETERS

### -AllowDownloadingNonWebViewableFiles
Expand Down Expand Up @@ -1155,8 +1171,11 @@ Accept wildcard characters: False
Determines what level of sharing is available for the site.

The valid values are:
ExternalUserAndGuestSharing (default) - External user sharing (share by email) and guest link sharing are both enabled. Disabled - External user sharing (share by email) and guest link sharing are both disabled.
ExternalUserSharingOnly - External user sharing (share by email) is enabled, but guest link sharing is disabled.

- ExternalUserAndGuestSharing (default) : External user sharing (share by email) and guest link sharing are both enabled.
- Disabled : External user sharing (share by email) and guest link sharing are both disabled.
- ExternalUserSharingOnly : External user sharing (share by email) is enabled, but guest link sharing is disabled.
- ExistingExternalUserSharingOnly : Only guests already in your organization's directory.

For more information about sharing, see Manage external sharing for your SharePoint online environment (https://learn.microsoft.com/sharepoint/turn-external-sharing-on-or-off).

Expand Down Expand Up @@ -1736,14 +1755,15 @@ Gets or sets collaboration type for fluid on core partition

The valid values are:

- Disabled
- ExternalUserSharingOnly
- ExternalUserAndGuestSharing
- ExistingExternalUserSharingOnly
- ExternalUserAndGuestSharing (default) : External user sharing (share by email) and guest link sharing are both enabled.
- Disabled : External user sharing (share by email) and guest link sharing are both disabled.
- ExternalUserSharingOnly : External user sharing (share by email) is enabled, but guest link sharing is disabled.
- ExistingExternalUserSharingOnly : Only guests already in your organization's directory.

```yaml
Type: SharingCapabilities
Parameter Sets: (All)
Accepted values: Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly

Required: False
Position: Named
Expand All @@ -1762,14 +1782,16 @@ If you have the external sharing for OneDrive for Business allowed, no further a

The valid values are:

- Disabled
- ExternalUserSharingOnly
- ExternalUserAndGuestSharing
- ExistingExternalUserSharingOnly
- ExternalUserAndGuestSharing (default) : External user sharing (share by email) and guest link sharing are both enabled.
- Disabled : External user sharing (share by email) and guest link sharing are both disabled.
- ExternalUserSharingOnly : External user sharing (share by email) is enabled, but guest link sharing is disabled.
- ExistingExternalUserSharingOnly : Only guests already in your organization's directory.


```yaml
Type: SharingCapabilities
Parameter Sets: (All)
Accepted values: Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly

Required: False
Position: Named
Expand Down Expand Up @@ -2403,6 +2425,14 @@ Accept wildcard characters: False
### -CoreSharingCapability
Sets what level of sharing is available for SharePoint sites (not including OneDrive sites).

The valid values are:

- ExternalUserAndGuestSharing (default) : External user sharing (share by email) and guest link sharing are both enabled.
- Disabled : External user sharing (share by email) and guest link sharing are both disabled.
- ExternalUserSharingOnly : External user sharing (share by email) is enabled, but guest link sharing is disabled.
- ExistingExternalUserSharingOnly : Only guests already in your organization's directory.


```yaml
Type: SharingCapabilities
Parameter Sets: (All)
Expand Down Expand Up @@ -2726,6 +2756,45 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -OneDriveSharingCapability

Determines what level of sharing is available for OneDrive for Business.

The valid values are:

- ExternalUserAndGuestSharing (default) : External user sharing (share by email) and guest link sharing are both enabled.
- Disabled : External user sharing (share by email) and guest link sharing are both disabled.
- ExternalUserSharingOnly : External user sharing (share by email) is enabled, but guest link sharing is disabled.
- ExistingExternalUserSharingOnly : Only guests already in your organization's directory.

For more information about sharing, see Manage external sharing for your SharePoint online environment (https://learn.microsoft.com/sharepoint/turn-external-sharing-on-or-off).

```yaml
Type: SharingCapabilities
Parameter Sets: (All)
Accepted values: Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly

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

### -GuestSharingGroupAllowListInTenantByPrincipalIdentity
Sets the guest sharing group allow list in the tenant by principal identity.

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

Expand Down
26 changes: 26 additions & 0 deletions src/Commands/Admin/SetTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,12 @@ 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; }

protected override void ExecuteCmdlet()
{
Expand Down Expand Up @@ -1532,6 +1538,26 @@ protected override void ExecuteCmdlet()
Tenant.CoreDefaultShareLinkRole = CoreDefaultShareLinkRole.Value;
modified = true;
}
if(OneDriveSharingCapability.HasValue)
{
Tenant.ODBSharingCapability = OneDriveSharingCapability.Value;
modified = true;
}
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity !=null)
{
if (GuestSharingGroupAllowListInTenantByPrincipalIdentity.Length > 0)
{
if (!string.IsNullOrEmpty(GuestSharingGroupAllowListInTenantByPrincipalIdentity[0].ToString()))
{
Tenant.GuestSharingGroupAllowListInTenantByPrincipalIdentity = GuestSharingGroupAllowListInTenantByPrincipalIdentity;
}
else
{
Tenant.GuestSharingGroupAllowListInTenantByPrincipalIdentity = new string[0];
}
}
modified = true;
}
if (BlockDownloadFileTypePolicy.HasValue)
{
if (!BlockDownloadFileTypePolicy.Value)
Expand Down
8 changes: 6 additions & 2 deletions src/Commands/Model/SPOTenant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,11 @@ public class SPOTenant
public SharingScope? CoreDefaultShareLinkScope { private set; get; }
public Role? CoreDefaultShareLinkRole { private set; get; }
public bool? SharePointAddInsDisabled { private set; get; }
#endregion
public SharingCapabilities? OneDriveSharingCapability { private set; get; }
public string[] GuestSharingGroupAllowListInTenantByPrincipalIdentity { private set; get; }
#endregion

public SPOTenant(Tenant tenant, ClientContext clientContext)
public SPOTenant(Tenant tenant, ClientContext clientContext)
{
HideDefaultThemes = tenant.HideDefaultThemes;
StorageQuota = tenant.StorageQuota;
Expand Down Expand Up @@ -785,6 +787,8 @@ public SPOTenant(Tenant tenant, ClientContext clientContext)
try { CoreDefaultShareLinkScope = tenant.CoreDefaultShareLinkScope; } catch { }
try { CoreDefaultShareLinkRole = tenant.CoreDefaultShareLinkRole; } catch { }
try { SharePointAddInsDisabled = tenant.SharePointAddInsDisabled; } catch { }
try { OneDriveSharingCapability = tenant.ODBSharingCapability; } catch { }
try { GuestSharingGroupAllowListInTenantByPrincipalIdentity = tenant.GuestSharingGroupAllowListInTenantByPrincipalIdentity?.ToArray(); } catch { }
}
}
}