Skip to content

Set-PnPUserProfileProperty : This operation requires you to be managing your own data or have administrator privileges #2153

@alan-hu

Description

@alan-hu

Found another issue #277 but my issue looks different in term of error message, so I am not sure if they are the same or different.

I have a cloud only account with active SPO Admin role,

To reproduce, run the following:
Connect-PnPOnline -Url https://my-tenant-admin-site.sharepoint.com -credential (get-credential)
Set-PnPUserProfileProperty -Account someone-else-in-my-org-upn -Property "custom-property-name" -Value "this is a single-line-of-text"

This custom user profile property is a string type of user profile property that is editable but hidden from users' Edit Profile screen.

And we received the following error:
Set-PnPUserProfileProperty : This operation requires you to be managing your own data or have administrator privileges.
At line:1 char:1
+ Set-PnPUserProfileProperty -Account xxx.yyy@zzz -Property ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (:) [Set-PnPUserProfileProperty], ServerException
+ FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.UserProfiles.SetUserProfileProperty
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions