Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Set-PnPUserProfileProperty : Access denied when set property for user #612

Closed
5 tasks
matsla opened this issue Apr 23, 2021 · 2 comments
Closed
5 tasks
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@matsla
Copy link

matsla commented Apr 23, 2021

Account running script has global admin rights. It's possible to update the property for current user executing the script, but access denied when try to update a property for a different account.

Set-PnPUserProfileProperty -Account $accountName -PropertyName "SPS-Birthday" -Value "2021-01-01"

Set-PnPUserProfileProperty : Access denied. You do not have permission to perform this action or access this resource.
At \Mac\Home\Desktop\Reset-UserProfiles.ps1:25 char:13

  •         Set-PnPUserProfileProperty -Account $p.AccountName -Prope ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : WriteError: (:) [Set-PnPUserProfileProperty], ServerUnauthorizedAccessException
    • FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.UserProfiles.SetUserProfileProperty

PnP Management Shell application has been granted correct permissions in Azure AD

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

V1.5.0

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

  • [ X] Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@matsla matsla added the bug Something isn't working label Apr 23, 2021
@veronicageek
Copy link
Collaborator

@matsla - To give you an update, this is not an issue with PnP PowerShell but has to do with how SharePoint Online handles authorization. We provided Microsoft with this feedback and are waiting for them to reply on it. We have no ETA when that will happen.

Note: Also related to issue #277.

@veronicageek veronicageek added the duplicate This issue or pull request already exists label Apr 23, 2021
@gautamdsheth
Copy link
Collaborator

Closing this as it is a duplicate and we are tracking it in #277

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants