Retrieve and Manage User Profile Properties in SharePoint 2010

I am writing a custom webpart that will output user profile information from SharePoint 2010. My code requires me to get quite a few fields. Most of these fields are not “intellisensable” and cannot be accessed directly without having to manually enter the field name, as you can see from my code snippet below.

User Profile Properties Code

But its really easy to get the user field properties incorrect. A good example, is retrieving the office location. You would think the property name would be called “OfficeLocation” but its actually called “SPS-Location”.

Luckily SharePoint allows us to view and access all the user profile properties we require and even create our own custom fields.

Lets start by opening Central Administration and navigate to Manage Service Applications > User Profile Service Application, which will take you to the following page:

User Profile Service Application

Click on “Manage User Properties” to view a list of all user field properties SharePoint uses. To either rename the display name or view the actual property name, click on a field and press “Edit”.

Manage User Properties

The “Name” field (as highlighted below) is not editable and for a very good reason too! These are the property ID’s that we will call when wanting to retrieve their value. All default field names are not editable.

Edit User Property

As I stated earlier, you can create your own properties and call them whatever you want. But SharePoint already provides us with so many out-of-the-box, you probably won’t need to create anymore anytime soon.

blog comments powered by Disqus

About

Surinder Bhomra is a Web Developer.

He has achieved a BSc in Information Systems in 2006 and since then has been working in the IT industry.

Prior to working in the Web Development industry I have spent 1.5 years working as an IT Systems Analyst providing support for internal company systems.

Working in the Web Development industry has given me the opportunity to expand my current skills and allowing me to work on website projects using ASP, ASP.NET, CSS, HTML and SQL.

StackOverflow Flair

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer’s view in any way.

>