When setting the MySiteHostUrl I get a UserProfileApplicationNotAvailableException

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 0 $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 account which is running PS script, in this example “xxx-spinstall”
  • Select “Full Control” and click OK
  • Run the PS-script again!

Permissions User Profile Application

Approaches to migrating your service applications

While working my way through TechNet documentation, I came across this very interesting table! It describes supported methods for service application migration.

The forth column shows the support for read-only database. You can find more information on read-only databases here: Run a farm that uses read-only databases (SharePoint Server 2010) [http://technet.microsoft.com/en-us/library/dd793608.aspx].

Service application

Database

Supported approach

Supports read-only

Notes

Access Services

None

not available

not available

 

Application Discovery and Load Balancing

None

not available

not available

Application Registry Service

Application Registry Service

Recreate

No

Business Data Connectivity

Business Data Connectivity

· Database attach

· Recreate

Excel Services

none

not available

not available

Microsoft SharePoint Foundation Subscription Settings

Subscription

Database attach

Managed Metadata Service

Managed Metadata Service

· Database attach

· Recreate

PerformancePoint Services

PerformancePoint Services

Recreate

PowerPoint Service

None

not available

not available

Project Server service application

· Draft

· Published

· Archive

· Reporting

Database attach

No

· Requires synchronization between the databases

· Need to configure time stamps or log marking

For more information, see Database-attach full upgrade to Project Server 2010

SharePoint Server Search

· Search Administration

· Crawl

· Property

· Recreate

· SharePoint backup and restore

No

· The index partitions are copied to the new farm and then restored on the new database server.

· The search topology is exported and then restored to the new server.

Secure Store

Secure Store

· Database attach

· Recreate

The pass phrase for the new database must be identical to the source database.

Security Token Service

Recreate

State Service

State

Recreate

No

Usage and Health Data Collection

Logging

Recreate

No

User Profile

· Profile

· Synchronization

· Social tagging

· Database attach

· Recreate

Profile requires the restoration of an encrypted FIM key

Visio Graphics Service

None

not available

not available

Web Analytics Service

· Staging

· Reporting

· Database attach

· Recreate

Word Automation Service

Word Automation Services

Recreate

not available

Word Viewing Service

None

not available

not available

 

How to: Turn on the State Service Application

When publishing a page in SharePoint or wanting to start a workflow you may receive the following error.

“The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator.”

This is likely caused because the State Service Application is not turned on. You can check this in the Central Administration » Application Management » Manage Service Applications. If the State Service Application is not listed you know why the message is showing.

There are two ways for activating the State Service Application. One is using the Farm Configuration Wizard (FCW). But I prefer via PowerShell, below the script for creating the new service application and add to default proxy group. If you like you can choose your own name parameters.

$serviceApp = New-SPStateServiceApplication -Name "State Service Application"
New-SPStateServiceDatabase -Name "StateService_DB" -ServiceApplication $serviceApp
New-SPStateServiceApplicationProxy -Name "State Service Application Proxy" -ServiceApplication $serviceApp –DefaultProxyGroup

More on TechNet on State Service:

http://technet.microsoft.com/en-us/library/ee704548.aspx