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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Added
- Added `Get-PnPMultiGeoCompanyAllowedDataLocation` cmdlet to retrieve SharePoint Online multi-geo allowed data locations. [#5336](https://github.com/pnp/powershell/pull/5336)
- Added `Get-PnPGeoMoveCrossCompatibilityStatus` cmdlet to retrieve SharePoint Online multi-geo move compatibility statuses.

### Changed
- Added properties `CoreOrganizationSharingLinkRecommendedExpirationInDays`, `CoreOrganizationSharingLinkMaxExpirationInDays`,`RestrictResourceAccountAccess`, `RestrictExternalSharingForAgents` to `Set-PnPTenant` and `Get-PnPTenant` cmdlet. [#5330](https://github.com/pnp/powershell/pull/5330)
Expand Down
59 changes: 59 additions & 0 deletions documentation/Get-PnPGeoMoveCrossCompatibilityStatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
Module Name: PnP.PowerShell
title: Get-PnPGeoMoveCrossCompatibilityStatus
schema: 2.0.0
applicable: SharePoint Online
external help file: PnP.PowerShell.dll-Help.xml
online version: https://pnp.github.io/powershell/cmdlets/Get-PnPGeoMoveCrossCompatibilityStatus.html
---

# Get-PnPGeoMoveCrossCompatibilityStatus

## SYNOPSIS
Returns compatibility statuses between SharePoint Online multi-geo locations.

## SYNTAX

```powershell
Get-PnPGeoMoveCrossCompatibilityStatus [-Connection <PnPConnection>]
```

## DESCRIPTION
Returns the compatibility between source and destination data locations for site moves in a multi-geo SharePoint Online tenant.

The returned status can be `Compatible`, `Incompatible`, `Warning`, or `Error`.

## EXAMPLES

### EXAMPLE 1

```powershell
Get-PnPGeoMoveCrossCompatibilityStatus
```

Returns the compatibility status for all source and destination geo location combinations.

## PARAMETERS

### -Connection
Optional connection to be used by the cmdlet. Retrieve the value for this parameter by specifying `-ReturnConnection` on `Connect-PnPOnline` or by executing `Get-PnPConnection`.

```yaml
Type: PnPConnection
Parameter Sets: (All)

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

## OUTPUTS

### PnP.PowerShell.Commands.Model.GeoMoveTenantCompatibilityCheck
Returns objects with `SourceDataLocation`, `DestinationDataLocation`, and `GeoMoveTenantCompatibilityResult` properties.

## RELATED LINKS

[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)
21 changes: 21 additions & 0 deletions src/Commands/Admin/GetGeoMoveCrossCompatibilityStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using PnP.PowerShell.Commands.Attributes;
using PnP.PowerShell.Commands.Base;
using PnP.PowerShell.Commands.Model;
using PnP.PowerShell.Commands.Utilities.MultiGeo;
using System.Management.Automation;

namespace PnP.PowerShell.Commands.Admin
{
[Cmdlet(VerbsCommon.Get, "PnPGeoMoveCrossCompatibilityStatus")]
[RequiredApiApplicationPermissions("sharepoint/Sites.FullControl.All")]
[RequiredApiDelegatedPermissions("sharepoint/AllSites.FullControl")]
[OutputType(typeof(GeoMoveTenantCompatibilityCheck))]
public class GetGeoMoveCrossCompatibilityStatus : PnPSharePointOnlineAdminCmdlet
{
protected override void ExecuteCmdlet()
{
var multiGeoRestApiClient = new MultiGeoRestApiClient(AdminContext);
WriteObject(multiGeoRestApiClient.GetGeoMoveCompatibilityChecks(), true);
}
}
}
13 changes: 13 additions & 0 deletions src/Commands/Model/GeoMoveCompatibilityChecks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace PnP.PowerShell.Commands.Model
{
/// <summary>
/// Contains SharePoint Online multi-geo move compatibility checks.
/// </summary>
public class GeoMoveCompatibilityChecks
{
/// <summary>
/// Compatibility checks between source and destination geo locations.
/// </summary>
public GeoMoveTenantCompatibilityCheck[] GeoMoveTenantCompatibilityChecks { get; set; }
}
}
16 changes: 16 additions & 0 deletions src/Commands/Model/GeoMoveCompatibilityValidationResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace PnP.PowerShell.Commands.Model
{
/// <summary>
/// Indicates whether a SharePoint Online multi-geo move can be performed between locations.
/// </summary>
public enum GeoMoveCompatibilityValidationResult
{
Compatible = 0,

Incompatible = 1,

Warning = 2,

Error = 3
}
}
26 changes: 26 additions & 0 deletions src/Commands/Model/GeoMoveTenantCompatibilityCheck.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Text.Json.Serialization;

namespace PnP.PowerShell.Commands.Model
{
/// <summary>
/// Contains the compatibility status for moving SharePoint Online sites between two geo locations.
/// </summary>
public class GeoMoveTenantCompatibilityCheck
{
/// <summary>
/// Source geo location code.
/// </summary>
public string SourceDataLocation { get; set; }

/// <summary>
/// Destination geo location code.
/// </summary>
public string DestinationDataLocation { get; set; }

/// <summary>
/// Compatibility status for moves between the source and destination geo locations.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public GeoMoveCompatibilityValidationResult GeoMoveTenantCompatibilityResult { get; set; }
}
}
7 changes: 7 additions & 0 deletions src/Commands/Utilities/MultiGeo/MultiGeoRestApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ internal class MultiGeoRestApiClient
private const string TenantRenameJobsPathToGetStatus = "TenantRenameJobs/Get";
private const string TenantRenameJobsPathToGetStatusV2 = "TenantRenameJobs/GetV2";
private const string TenantRenameJobsPathToCancelAJob = "TenantRenameJobs/Cancel";
private const string GeoMoveCompatibilityChecksApiVersion = "1.3.6";
private const string GeoMoveCompatibilityChecksPath = "GeoMoveCompatibilityChecks";
private const string AllowedDataLocationsApiVersion = "1.3.11";
private const string AllowedDataLocationsPath = "AllowedDataLocations";
private const int MaximumPagination = 10;
Expand Down Expand Up @@ -61,6 +63,11 @@ internal IEnumerable<string> GetTenantRenameWarningMessages()
return GetFeed<string>(TenantRenameJobsPathToGetWarningMessages, TenantRenameApiVersion);
}

internal IEnumerable<GeoMoveTenantCompatibilityCheck> GetGeoMoveCompatibilityChecks()
{
return Get<GeoMoveCompatibilityChecks>(GeoMoveCompatibilityChecksPath, GeoMoveCompatibilityChecksApiVersion)?.GeoMoveTenantCompatibilityChecks ?? Array.Empty<GeoMoveTenantCompatibilityCheck>();
}

internal IEnumerable<MultiGeoCompanyAllowedDataLocation> GetAllowedDataLocations()
{
return GetFeed<MultiGeoCompanyAllowedDataLocation>(AllowedDataLocationsPath, AllowedDataLocationsApiVersion);
Expand Down
Loading