0

We created a custom user profile property.

We want to read it's value via CSOM (or PnP, doesn't matter).

We fail.

Our property is not returned in the list of user profile properties. Other properties are returned. Our custom property is not.

This property is configured like this:

  • multi-valued
  • length: 3600
  • Optional
  • Visible to "Only me"
  • Not Replicable
  • Editable by user
  • Not visible anywhere (used in SPFx solution)

This other post reports a similar effect. This post from 2013 claims that properties with visibility "Only me" cannot be retrieved via CSOM.

I want this to clear this up for SharePoint Online:

Is it possible to read each and every user profile property via CSOM? If not: What could be the reason for a property not being returned? I did not find any documentation so far.

  • 1
    what's the security context that's executing the CSOM? The same user, or a different user? – Derek Gusoff Oct 18 '18 at 12:45
  • @DerekGusoff the SharePoint admin who wants to set the property for > 1000 users – Heinrich Ulbricht Oct 18 '18 at 16:15
1

Works for me. I can see "Only Me" properties on users and their values while logged in as a tenant admin using this.

$act = Get-PnPUserProfileProperty -Account 'user@tenant.onmicrosoft.com'
$act.UserProfileProperties

Get-PnPUserProfileProperty uses CSOM under the covers. So if it's not coming back for you, there's either an issue with your code, or with your security context.

0

Using PowerShell you can read properties that have visibility set to only me .

For example you can try this ,

$propertyValue = $userprofile["ExampleProperty"].value

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.