Skip to content

Add PnP geo administrator cmdlet#5381

Merged
gautamdsheth merged 1 commit into
devfrom
gautamdsheth-planning-geo-admin
Jul 3, 2026
Merged

Add PnP geo administrator cmdlet#5381
gautamdsheth merged 1 commit into
devfrom
gautamdsheth-planning-geo-admin

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 Add-PnPGeoAdministrator to mirror SharePoint Online Management Shell's Add-SPOGeoAdministrator for multi-geo administrators.

The cmdlet supports the same UserPrincipalName, GroupAlias, and ObjectId parameter sets, reuses the existing multi-geo REST client, and posts to the GeoAdministrators API with matching payload shape and no output. This also adds the minimal internal models, documentation, and Current nightly changelog entry.

Validation included building the project and comparing command metadata and payload serialization with the SPO module.

Guidance

N/A

Copilot AI review requested due to automatic review settings July 3, 2026 20:41

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

This PR adds a new SharePoint Online admin cmdlet, Add-PnPGeoAdministrator, to manage multi-geo administrators via the existing MultiGeo REST API infrastructure.

Changes:

  • Introduces Add-PnPGeoAdministrator with parameter sets for UserPrincipalName, GroupAlias, and ObjectId.
  • Extends MultiGeoRestApiClient with a GeoAdministrators POST operation and API-version gating.
  • Adds minimal internal request/response models, enum, and cmdlet documentation.

Reviewed changes

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

Show a summary per file
File Description
src/Commands/Utilities/MultiGeo/MultiGeoRestApiClient.cs Adds GeoAdministrators endpoint support and version checks.
src/Commands/Model/GeoAdministratorEntityData.cs Introduces request payload model for adding geo admins.
src/Commands/Model/GeoAdministrator.cs Introduces response model (extends request payload with GeoLocation).
src/Commands/Enums/GroupMemberType.cs Adds enum for principal type serialization.
src/Commands/Admin/AddGeoAdministrator.cs Adds the new Add-PnPGeoAdministrator cmdlet implementation.
documentation/Add-PnPGeoAdministrator.md Adds user-facing cmdlet documentation with examples and syntax.
CHANGELOG.md Adds a “Current nightly” entry for the new cmdlet.

Comment thread CHANGELOG.md Outdated
Comment thread src/Commands/Admin/AddGeoAdministrator.cs Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@gautamdsheth gautamdsheth force-pushed the gautamdsheth-planning-geo-admin branch from 7532d82 to a0743ac Compare July 3, 2026 21:13
@gautamdsheth gautamdsheth merged commit 9ee692f into dev Jul 3, 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