Manage user properties up in SharePoint with PowerShell

We encountered an issue when we created a custom property in the User Profile Service Application and we wanted to move this property to ‘Contact Information’. We could click on the up arrow but the property remained on the same spot after the refresh. We have discussed this issue with Microsoft and they have provided us with the below solution. This solution is not yet fully supported on SharePoint 2013 and they are in the process of creating a KB article for this issue, but this can perhaps help you as a workaround.

Scenario

I have created a new property called ‘Custom’ that I want to add to contact information

image

After a lot of clicking and refreshing I managed to get it till ‘Picture Placeholder State’ but could not get it to move higher

image

Issue

You can view the display ID with PowerShell for all user properties using the following commands.

First create a connection to the User Profile Manager

1
2
3
$MySite = Get-SPSite
$context = Get-SPServiceContext $MySite
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)

image

Then type

1
$profilemanager.properties | ft name,displayorder

To view the current order

image

My custom property has the same order as ‘Picture Placeholder State’ which perhaps stops it from moving up.

image

Solution

You can set the display order for a property using PowerShell but always make sure this ID does not exist and only use this command when you get stuck from moving a property up.

In this scenario I will move it to 5101 which is above ‘WorkEmail’

1
2
$profileManager.Properties.SetDisplayOrderByPropertyName("Custom",5101)
$profileManager.Properties.CommitDisplayOrder()

image

image

Before you will see the change please dont forger about IIS reset, start you UPS full synchronization again and make start full crawler on your profiles source.

From now on you should be able to notice changes in you mysite profile site etc.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s