When setting the MySiteHostUrl I get a UserProfileApplicationNotAvailableException

Bram de Jager - Architect, Speaker, Author

When I’m trying to set the MySiteHostUrl via PowerShell it throws an error. Taking a closer look it seems after initializing the UserProfileManager class an UserProfileApplicationNotAvailableException is raised.

The exception you receive is

New-Object : Exception calling “.ctor” with “1” argument(s): “UserProfileApplicationNotAvailableException_Logging :: UserProfileApplicationProxy.ApplicationProperties ProfilePropertyCache does not have 458839b6-4979-413a-a7a3-41d8564faea3”

The PowerShell script I’m using is retrieving the current context and initializing the UserProfileManager object. This should provide me access to the MySiteHostUrl.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ea $site= Get-SPSite “http://my.contoso.com” $context= Get-SPServiceContext($site) $upm= New-Object -TypeName Microsoft.Office.Server.UserProfiles.UserProfileManager -ArgumentList $context$upm.MySiteHostURL = “http://my.contoso.com”

The solution to this is providing the account running the PowerShell script sharing permissions “Full Control” on the User Profile Service Application.

  • Open Central Administration
  • Click Service Applications
  • Select “User Profile Service Application”
  • Click in ribbon the Permissions button
  • Add…

View original post 21 more words

Change order of user profile properties in SharePoint 2013 with Powershell

Radu Tut

Management of user profile properties in SharePoint CA user interface is easy and intuitive, but when it comes to changing the display order of user profile properties, this becomes a difficult and frustrating task (and it has been like this since 2007). Powershell scripting proves again very handy.

You can find several other blog posts on this topic, but all I have found use the obsolete SharePoint API (2007) to do this.

First of all we need a PS script to list the current order of user profile properties.

Next step would be to set up a configuration xml file, that lets us define what properties we want to change. The following config sample will change the display order of two user profile properties.

The final step, the PS script that makes the changes. The function for update requires two input parameters: a config file path, and the my site url.

View original post 116 more words