powershell
powershell copied to clipboard
[BUG] PnP PowerShell cannot load or process SharePoint users whose UPN contains an apostrophe (`'`).
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
-
Connect to a SharePoint Online site:
Connect-PnPOnline -Url "https://contoso.sharepoint.com/sites/demo" -Interactive -
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