Add Remove-PnPGeoAdministrator cmdlet#5380
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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-PnPGeoAdministratorcmdlet implementation with three parameter sets (user, group, object ID). - Extended
MultiGeoRestApiClientto support geo administrator deletion via POST +X-HTTP-Method: DELETEwith 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. |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Related Issues?
N/A
What is in this Pull Request ?
Adds
Remove-PnPGeoAdministratorso 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-gatedGeoAdministratorspaths, and the same user/group member type values. Documentation and the current nightly changelog are included.Guidance
N/A