Skip to content

Fix apostrophes in user profile REST calls - #5459

Merged
KoenZomers merged 2 commits into
pnp:devfrom
till-llit:fix/user-profile-apostrophe-odata
Sep 2, 2026
Merged

Fix apostrophes in user profile REST calls#5459
KoenZomers merged 2 commits into
pnp:devfrom
till-llit:fix/user-profile-apostrophe-odata

Conversation

@till-llit

Copy link
Copy Markdown
Contributor

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Fixes #5458

What is in this Pull Request ?

Fixes SharePoint REST/OData requests for UPNs containing apostrophes.
Doubles apostrophes before URL encoding, as required by OData string literals.
Applies to:

  • ExportUserProfile.cs
  • ExportUserInfo.cs
  • RemoveUserProfile.cs
  • RemoveUserInfo.cs

Also safely encodes RedactName in Remove-PnPUserInfo.
This resolves errors such as The query string "accountName" is missing or invalid. for users like alex.o'connor@example.com.

@KoenZomers

Copy link
Copy Markdown
Collaborator

Thanks @till-llit for your contribution!

@KoenZomers
KoenZomers merged commit 5c6a7e4 into pnp:dev Sep 2, 2026
2 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.

[BUG] PnP PowerShell cannot load or process SharePoint users whose UPN contains an apostrophe (').

2 participants