Skip to content

Add Remove-PnPGeoAdministrator cmdlet#5380

Merged
gautamdsheth merged 3 commits into
devfrom
gautamdsheth-plan-geo-admin-removal
Jul 3, 2026
Merged

Add Remove-PnPGeoAdministrator cmdlet#5380
gautamdsheth merged 3 commits into
devfrom
gautamdsheth-plan-geo-admin-removal

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 Remove-PnPGeoAdministrator so PnP PowerShell can remove SharePoint Online geo administrators using the same identity forms exposed by the SPO management shell: user principal name, group alias, and object ID.

The implementation reuses the existing MultiGeo REST client and matches the SPO request shape: POST with X-HTTP-Method: DELETE, empty body, version-gated GeoAdministrators paths, and the same user/group member type values. Documentation and the current nightly changelog are included.

Guidance

N/A

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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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 introduces a new SharePoint Online Admin cmdlet, Remove-PnPGeoAdministrator, enabling removal of geo administrators by UPN, group alias, or object ID via the existing MultiGeo REST API client.

Changes:

  • Added Remove-PnPGeoAdministrator cmdlet implementation with three parameter sets (user, group, object ID).
  • Extended MultiGeoRestApiClient to support geo administrator deletion via POST + X-HTTP-Method: DELETE with version-gated endpoints.
  • Added cmdlet documentation and a changelog entry.

Reviewed changes

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

File Description
src/Commands/Utilities/MultiGeo/MultiGeoRestApiClient.cs Adds REST client support for removing geo administrators, including API-version gating and a method-override helper.
src/Commands/Admin/RemoveGeoAdministrator.cs Introduces the new admin cmdlet wiring to the MultiGeo REST client.
documentation/Remove-PnPGeoAdministrator.md Adds end-user documentation for the new cmdlet, syntax, parameters, and examples.
CHANGELOG.md Adds an entry under Current nightly → Added for the new cmdlet.

Comment thread src/Commands/Admin/RemoveGeoAdministrator.cs
Comment thread CHANGELOG.md
gautamdsheth and others added 2 commits July 4, 2026 00:03
Resolve conflicts with Get-PnPGeoAdministrator additions and add the PR link to the Remove-PnPGeoAdministrator changelog entry.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Update Remove-PnPGeoAdministrator to dispatch by ParameterSetName and remove the generic empty GUID fallback.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@gautamdsheth gautamdsheth merged commit d234ad2 into dev Jul 3, 2026
5 checks passed
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