Skip to content

Add Set-PnPMultiGeoExperience cmdlet#5369

Merged
gautamdsheth merged 3 commits into
devfrom
gautamdsheth-set-spo-multigeo-experience
Jun 28, 2026
Merged

Add Set-PnPMultiGeoExperience cmdlet#5369
gautamdsheth merged 3 commits into
devfrom
gautamdsheth-set-spo-multigeo-experience

Conversation

@gautamdsheth

Copy link
Copy Markdown
Collaborator

Before creating a pull request, make sure that you have read the contribution file located at

https://github.com/pnp/powerShell/blob/dev/CONTRIBUTING.md

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

N/A

What is in this Pull Request ?

Adds Set-PnPMultiGeoExperience to upgrade the tenant multi-geo experience to include SharePoint Online Multi-Geo.

The implementation reuses the existing MultiGeoRestApiClient and mirrors the SharePoint Online Management Shell behavior for the GeoExperience/UpgradeToSPOMode and GeoExperience/UpgradeAllInstancesToSPOMode endpoints, minimum API version 1.3.7, empty POST body, confirmation text, success output, and unsupported-version error message. It also adds cmdlet documentation and a changelog entry.

Validated with dotnet build src\Commands\PnP.PowerShell.csproj --no-restore.

Guidance

N/A

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 28, 2026 18:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new SharePoint Online admin cmdlet to upgrade a tenant’s Multi-Geo experience to include SharePoint Online Multi-Geo, implemented via the existing MultiGeoRestApiClient and accompanied by docs + a changelog entry.

Changes:

  • Extended MultiGeoRestApiClient with GeoExperience upgrade endpoints and minimum API version gating.
  • Added Set-PnPMultiGeoExperience cmdlet with an -AllInstances switch to trigger the upgrade.
  • Added cmdlet documentation and a [Current nightly] changelog entry.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/Commands/Utilities/MultiGeo/MultiGeoRestApiClient.cs Adds GeoExperience upgrade endpoint support and version checks.
src/Commands/Admin/SetMultiGeoExperience.cs Introduces Set-PnPMultiGeoExperience cmdlet calling the new REST client operation.
documentation/Set-PnPMultiGeoExperience.md Adds end-user documentation for the new cmdlet.
CHANGELOG.md Adds a release note entry for the new cmdlet.

Comment on lines +20 to +32
protected override void ExecuteCmdlet()
{
var multiGeoRestApiClient = new MultiGeoRestApiClient(AdminContext);
multiGeoRestApiClient.EnsureGeoExperienceUpgradeSupported();

if (!ShouldContinue(UpgradeConfirmationMessage, string.Empty))
{
return;
}

multiGeoRestApiClient.UpgradeGeoExperience(AllInstances.ToBool());
WriteObject(UpgradeCompletedMessage);
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed by gating the upgrade with ShouldProcess before the version check and confirmation prompt, so -WhatIf/-Confirm are honored.

Comment on lines +14 to +15
private const string UpgradeConfirmationMessage = "This operation will upgrade your instance's multi-geo experience to include SharePoint Online Multi-Geo. This upgrade action is not reversible. Confirm that you want to continue this upgrade operation.";
private const string UpgradeCompletedMessage = "This upgrade operation will take some time to take effect. Please run the cmdlet Get-SPOMultiGeoExperience to check the latest mode.";

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping the runtime completion string exact for SharePoint Online Management Shell parity. I clarified in the cmdlet documentation that Get-SPOMultiGeoExperience is a SharePoint Online Management Shell cmdlet.

Comment thread CHANGELOG.md
Comment on lines 11 to 13
### Added
- Added `Set-PnPMultiGeoExperience` cmdlet to upgrade the tenant multi-geo experience to include SharePoint Online Multi-Geo.
- Added `Get-PnPSiteContentMoveState` cmdlet to retrieve SharePoint Online site content move states. [#5365](https://github.com/pnp/powershell/pull/5365)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed by adding the PR link to the changelog entry.

Comment on lines +104 to +106
### System.String
Returns `This upgrade operation will take some time to take effect. Please run the cmdlet Get-SPOMultiGeoExperience to check the latest mode.`

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed by clarifying in the Outputs section that the returned message is the SharePoint Online Management Shell completion message and that Get-SPOMultiGeoExperience belongs to that module.

gautamdsheth and others added 2 commits June 28, 2026 22:09
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gautamdsheth gautamdsheth merged commit b74f3b9 into dev Jun 28, 2026
5 checks passed
gautamdsheth added a commit that referenced this pull request Jul 9, 2026
* Add Get, Grant, Set and Revoke cmdlets for EntraID app list permissions

Implements ListItems.SelectedOperations.Selected support via the Microsoft
Graph beta API. Lists can be addressed by GUID or display name. Permission
roles use the correct list-level values (Read, Write, Owner). Display names
are enriched via service principal lookup since the Graph beta API omits
them on GET responses. Documentation included.

* Add Get, Grant, Set and Revoke cmdlets for EntraID app list item permissions

Implements ListItems.SelectedOperations.Selected support via the Microsoft
Graph beta API. The -ListItem parameter accepts the integer item ID only.
Lists can be addressed by GUID or display name. Permission roles use the
correct list-level values (Read, Write, Owner). Display names are enriched
via service principal lookup since the Graph beta API omits them on GET
responses. Documentation included.

* Add Get, Grant, Set and Revoke cmdlets for EntraID app file permissions

Implements Files.SelectedOperations.Selected support via the Microsoft
Graph Drive API. Files can be addressed by path relative to the library
root (e.g. Folder/file.docx) or by Graph drive item ID. The drive is
resolved through the list's associated drive endpoint. Permission roles
use the correct values (Read, Write, Owner). Documentation included.

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Add GitHub workflows for PnP Core and PnP Framework builds (#5314)

* Refactor build workflows to pack NuGet packages and create zip files for PnP.Core and PnP.Framework (#5315)

* Add GitHub workflows for PnP Core and PnP Framework builds

* Refactor build workflows to pack NuGet packages and create zip files for PnP.Core and PnP.Framework

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gautamdsheth <8832018+gautamdsheth@users.noreply.github.com>

* Nightly publish to PowerShell Gallery

* Updates pnp framework build workflow (#5316)

* Nightly publish to PowerShell Gallery

* Updates the pnp framework workflow (#5317)

* Sets the cron schedule for the pnp framework build (#5319)

* Nightly publish to PowerShell Gallery

* Bugfix for connection

* Updates PnP.Core build workflow (#5321)

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Update GitHub Actions to use latest versions of actions and dependencies (#5323)

* Nightly publish to PowerShell Gallery

* Update documentation build workflows and Dockerfiles to use latest versions of DocFX and .NET (#5324)

* Update documentation build workflows and Dockerfiles to use latest versions of DocFX and .NET

* Add documentation for building the site locally and update .gitignore

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Add properties

* Update AllowFileArchiveOnNewSitesByDefault

* Update with changes after merge

* Add additional parameters to site

* Update with properties

* Nightly publish to PowerShell Gallery

* update to add props

* Update CHANGELOG with recent changes and contributors

Added new properties to Set-pnptenant and Get-pnptenant cmdlets and updated contributors section.

* Add WhoCanShareAllowListInTenantByPrincipalIdentity support (#5322)

Introduce new parameter to Set-Tenant cmdlet for specifying principal identities allowed to share content at the tenant level. Update cmdlet logic to handle assignment and clearing of this list. Add corresponding property to SPOTenant model with documentation.

Co-authored-by: Vasco Azevedo <vasco.azevedo@bindtuning.com>
Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* updated documentation (#5328)

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Enhance documentation and add support for dark mode in the theme selector (#5332)

* Update documentation and build scripts for improved clarity and functionality

* Enhance documentation and add support for dark mode in the theme selector

* Update documentation

* Enhance documentation with additional descriptions and links for articles, cmdlets, and installation processes; add new llms.txt file for quick reference. (#5334)

* Enhance documentation and functionality to support Linux Secret Service for managing App Ids across platforms (#5335)

* Enhance documentation and functionality to support Linux Secret Service for managing App Ids across platforms

* Enhance documentation and error handling for Linux Secret Service support in Get-PnPManagedAppId, Remove-PnPManagedAppId, and Set-PnPManagedAppId cmdlets

* Nightly publish to PowerShell Gallery

* Update CHANGELOG with new cmdlet properties

Added new properties to Set-pnptenant, Get-pnptenant, set-pnpsite, and set-pnptenantsite cmdlets.

* Add Get-PnPMultiGeoCompanyAllowedDataLocation cmdlet and related model for allowed data locations (#5336)

* Add Get-PnPMultiGeoCompanyAllowedDataLocation cmdlet and related model for allowed data locations

* Update CHANGELOG to include Get-PnPMultiGeoCompanyAllowedDataLocation cmdlet

* Add Get-PnPGeoMoveCrossCompatibilityStatus cmdlet and related models for geo move compatibility checks (#5337)

* Add Get-PnPUserAndContentMoveState cmdlet and related model for user and content move state retrieval (#5338)

* Add favicon and implement markdown copy functionality with UI enhancements (#5339)

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Fixes to multi-geo cmdlets (#5343)

* Fix markdown and related issues (#5344)

* Fix markdown and related issues

* Fix docs script

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Added mention of 3 PRs from fabianhutzli

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Add conditional execution for workflows based on repository owner (#5345)

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Update documentation and error handling for Viva Connections Dashboard ACE commands to reflect support for Team and Communication sites (#5351)

* Update documentation and error handling for Viva Connections Dashboard ACE commands to reflect support for Team and Communication sites

* Update documentation and error messages for Viva Connections Dashboard ACE commands to specify SharePoint Team site requirement

* Enhance error handling in RemoveServicePrincipalRoleAssignment methods and update return types to indicate success or failure (#5353)

* Enhance error handling in RemoveServicePrincipalRoleAssignment methods and update return types to indicate success or failure

* Update permissions and documentation for Add-PnPTeamsChannel and ServicePrincipalUtility methods

* Improve error messaging for missing app role assignments in RemoveEntraIDServicePrincipalAssignedAppRole cmdlet

* Refactor ClientContext execution flow in list item commands to ensure proper loading and updating of items (#5354)

* Add Start-PnPUserAndContentMove cmdlet for multi-geo user and content migration (#5355)

* Add Start-PnPUserAndContentMove cmdlet for multi-geo user and content migration

* Update CHANGELOG.md to include pull request reference for Start-PnPUserAndContentMove cmdlet

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Added Microsoft ToDo cmdlets

* Updated cmdlet numer

* Added reference to PR 5356 on ToDo cmdlets

Added cmdlets for managing Microsoft To Do tasks and updated tenant properties.

* Fixing changelog instruction

* Delete src/Commands/CHANGELOG.md as it was in the wrong place

* Nightly publish to PowerShell Gallery

* Update CHANGELOG with new cmdlets and fixes

Added multiple cmdlets for Microsoft To Do tasks and improved existing cmdlets with new properties and fixes.

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Update Microsoft.Identity.Client.Extensions.Msal version

Updated Microsoft.Identity.Client.Extensions.Msal package version to 4.85.2.

* Update AzureEnvironment accepted values in documentation for cloud support (#5361)

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Add Get-PnPUnifiedGroupMoveState cmdlet (#5362)

* Add unified group move state cmdlet


* Address unified group move state review

* Add Stop-PnPUserAndContentMove cmdlet (#5363)

* Add stop user and content move cmdlet

Add Stop-PnPUserAndContentMove using the existing multigeo REST client and SPO-compatible cancel endpoint, output, and parameter shape.

* Address user move stop review feedback

Reuse the existing UPN move job path when building the cancel endpoint and add the PR reference to the changelog entry.

* Add Start-PnPUnifiedGroupMove cmdlet (#5364)

* Add unified group move cmdlet

* Address unified group move review feedback

* Add Get-PnPSiteContentMoveState (#5365)

* Add site content move state cmdlet

Adds Get-PnPSiteContentMoveState using the existing multi-geo REST client, SPO-compatible site move endpoints, site move output formatting, documentation, and changelog coverage.

* Add PR link to changelog entry

* Add Stop-PnPSiteContentMove cmdlet (#5366)

* Add Start-PnPSiteContentMove cmdlet (#5367)

* Add site content move cmdlet

Implement Start-PnPSiteContentMove using the existing MultiGeo REST client and site move response formatting.

# Conflicts:
#	src/Commands/Utilities/MultiGeo/UserAndContentMoveStateFormatter.cs

* Fix site move rebase conflict

Remove stale generic site move formatting after rebasing onto the dedicated SiteMoveJob formatter from dev.

* Nightly publish to PowerShell Gallery

* Add Set-PnPMultiGeoCompanyAllowedDataLocation (#5368)

* Add Set-PnPMultiGeoCompanyAllowedDataLocation

Adds the PnP cmdlet and matching multigeo REST client path to start setting up an allowed SharePoint Online data location.


* Address Set-PnPMultiGeo review feedback

Adds output metadata and the changelog PR reference while preserving SPO-compatible REST and confirmation behavior.

* Add Set-PnPMultiGeoExperience cmdlet (#5369)

* Add Set-PnPMultiGeoExperience cmdlet

* Address Set-PnPMultiGeoExperience review comments

* Add Get-PnPGeoStorageQuota cmdlet (#5371)

* Add Set-PnPGeoStorageQuota cmdlet (#5370)

* Fix cmdlet references in documentation and resources for multi-geo experience

* Add Get-PnPMultiGeoExperience cmdlet (#5372)

* Add Get-PnPMultiGeoExperience cmdlet

* Add PR link to multigeo changelog entry

* Enhance JSON serialization options to allow reading numbers from strings

* Add support for minimum API version checks and enhance move state output formatting

* Enhance site move job creation with confirmation handling for marketplace apps and workflows

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Add Get-PnPGeoAdministrator cmdlet (#5378)

* Add Get-PnPGeoAdministrator cmdlet


* Link Get-PnPGeoAdministrator changelog entry

* Add Remove-PnPGeoAdministrator cmdlet (#5380)

* Add Remove-PnPGeoAdministrator cmdlet

Add a PnP cmdlet for removing SharePoint Online geo administrators through the existing MultiGeo REST client. Match the SPO management shell request shape for user, group, and object ID removal.

* Use parameter set dispatch for geo admin removal

Update Remove-PnPGeoAdministrator to dispatch by ParameterSetName and remove the generic empty GUID fallback.

* Add PnP geo administrator cmdlet (#5381)

* Add Remove-PnPMultiGeoCompanyAllowedDataLocation (#5379)

* Add validation for ObjectId in AddGeoAdministrator and RemoveGeoAdministrator cmdlets; ensure Geo Administrator support in MultiGeoRestApiClient

* Nightly publish to PowerShell Gallery

* Add support for applying built-in Microsoft site designs (store 1) (#5358)

The existing Get-PnPSiteDesign and Invoke-PnPSiteDesign cmdlets used CSOM
(Tenant.GetSiteDesigns / Tenant.ApplySiteDesign) which only works for
tenant-registered custom designs (store 0). Microsoft's built-in site
designs such as Event, Department and Human Resources live in the SharePoint
site template store (store 1) and require the SiteScriptUtility REST API
with a store parameter — there was no way to reach them from PnP PowerShell.

- Add Get-PnPSiteDesign -BuiltIn switch: calls SiteScriptUtility.GetSiteDesigns
  with store 1 and returns BuiltInSiteDesign objects (Id, Title, Template enum)
- Add Invoke-PnPSiteDesign -Template <BuiltInSiteTemplates>: resolves the GUID
  from the existing BuiltInSiteTemplates enum mapping and calls
  SiteScriptUtility.ApplySiteDesign with store 1
- Add BuiltInSiteDesign model class for deserialising the REST response
- Add GetBuiltInSiteDesigns and ApplyBuiltInSiteDesign utility methods to
  SiteTemplates.cs so the REST logic is centralised
- Fix missing DefaultParameterSetName on Get-PnPSiteDesign to prevent
  ambiguous parameter set error when called without arguments
- Update documentation for both cmdlets with new syntax, parameter descriptions
  and usage examples

Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>

* Update CHANGELOG with new cmdlet features and fixes

Updated CHANGELOG with new cmdlet properties and fixes.

* Add Get-PnPUserOneDriveLocation cmdlet (#5382)

* Add user OneDrive location cmdlet

* Address OneDrive location review feedback

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Nightly publish to PowerShell Gallery

* Cross-reference minimal-permissions page migration guide (#5383)

* Nightly publish to PowerShell Gallery

* Update PnP.PowerShell.csproj

* Update Build-Release.ps1

* Major release to PowerShell Gallery

* Update CHANGELOG.md

---------

Co-authored-by: Fabian Hutzli <fabian.hutzli@mobi.ch>
Co-authored-by: erwinvanhunen <erwinvanhunen@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gautamdsheth <8832018+gautamdsheth@users.noreply.github.com>
Co-authored-by: Adam Wójcik <58668583+Adam-it@users.noreply.github.com>
Co-authored-by: Koen Zomers <koen@zomers.eu>
Co-authored-by: Reshmee Auckloo <reshmee011@gmail.com>
Co-authored-by: Vasco Azevedo <vascoazevedo70@gmail.com>
Co-authored-by: Vasco Azevedo <vasco.azevedo@bindtuning.com>
Co-authored-by: Tetronic <49990832+Tetronic@users.noreply.github.com>
Co-authored-by: gautamdsheth <gautamdsheth@users.noreply.github.com>
Co-authored-by: Fabian Hutzli <136681117+fabianhutzli@users.noreply.github.com>
Co-authored-by: Rick Zhu <zhenhzhu@126.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants