powershell icon indicating copy to clipboard operation
powershell copied to clipboard

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

Open till-llit opened this issue 3 months ago • 0 comments

Reporting an Issue or Missing Feature

Bug: PnP PowerShell cannot load or process SharePoint users whose UPN contains an apostrophe (').

Expected behavior

Export-PnPUserProfile should export the profile for a valid UPN containing an apostrophe.

Actual behavior

Export-PnPUserProfile fails with an invalid or missing accountName error:

Export-PnPUserProfile -LoginName "alex.o'[email protected]"
Export-PnPUserProfile: {"odata.error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"The query string \"accountName\" is missing or invalid."}}}

Steps to reproduce behavior

  1. Connect to a SharePoint Online site:

    Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/demo" -Interactive
    
  2. Export the user profile:

    Export-PnPUserProfile -LoginName "alex.o'[email protected]"
    

3 Observe that the user cannot be loaded and Export-PnPUserProfile reports that the accountName query string is missing or invalid.

What is the version of the Cmdlet module you are running?

3.4.1

Which operating system/environment are you running PnP PowerShell on?

  • [x] Windows
  • [ ] Linux
  • [ ] MacOS
  • [ ] Azure Cloud Shell
  • [ ] Azure Functions
  • [ ] Other: Windows PowerShell console

till-llit avatar Aug 31 '26 13:08 till-llit