The definitive guide of How to configure the SharePoint 2010 User Profile Service Application

I took me hours and hours to get to User Profile Service Application working.

These are the steps I’ve done in some scenarios.

Especial to migrate an SharePoint 2007 profile database to SharePoint 2010.

0. The databases for the User Profile Service Application must run on the standard instance of SQL Server. NEVER use a named instance. – Always use SQL Aliases instead!!!

1. (Skip this next step if you don’t need to migrate.) Backup the Shared Service Provider Database of your MOSS farm.

2. Restore the farm to your destination SQL Server instance and with the destination database name, e.g. “SP_SvcApp_UserProfile_Profiles”.

(In the MOSS farm the database was named “MOSS_SSP_Config” !!! –> It’s the configuration database of the Shared Service Provider.)

3. Create the User Profile Service Application with this PowerShell script:

#region Check x64 host
if( [System.IntPtr]::Size -ne 8) {
  Write-Error "Please use a x64 PowerShell host!"
  return
}
#endregion

#region Load SharePoint SnapIn and DLL
  Remove-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
  Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

  [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")  | out-null    

  #Check available SharePoint Cmdlets
  if( (Get-Command -Noun SPWeb*) -eq $null ) {
    Write-Error "SharePoint SnapIn not loaded. SharePoint cmdlets missing!"
    return
  }
#endregion

cls

######################################################################################################

# Profile database in my MOSS farm : MOSS_SSP_CONFIG 

#---------------------------------------------------------------------------
# Settings

$farmname = "SP"

$spfarmuser='DOMAINsp_farm'
$spfarmpwd='passwort1#'
$mysiteHostLocation = "http://mysite.sharepoint.local"
$mysiteManagedPath = "/personal"

#---------------------------------------------------------------------------

$spfarmcredentials = new-object -typename System.Management.Automation.PSCredential -argumentlist $spfarmuser, (ConvertTo-SecureString $spfarmpwd -AsPlainText -force)
$userprofileAppProfileDBName =("{0}_SvcApp_UserProfile_Profiles" -f $farmname)
$userprofileAppProfileSyncDBName =("{0}_SvcApp_UserProfile_Sync" -f $farmname)
$userprofileAppProfileSocialDBName =("{0}_SvcApp_UserProfile_Social" -f $farmname)
$svcAppPool=("{0}_AppPool_UserProfile" -f $farmname)

# Create application pool
$appPool = (Get-SPServiceApplicationPool -Identity $svcAppPool -ErrorAction SilentlyContinue)
if( $appPool -eq $null ) {
  $appPool = (New-SPServiceApplicationPool -Account $spfarmuser -Name $svcAppPool)
}

$userProfileSvcApp = (Get-SPServiceApplication  | ? { $_.TypeName -eq "User Profile Service Application" })

# Create service application
if( $userProfileSvcApp -eq $null ) {
  $userProfileSvcApp = (New-SPProfileServiceApplication -ApplicationPool $appPool -MySiteHostLocation  $mysiteHostLocation `
                          -MySiteManagedPath $mysiteManagedPath -ProfileDBName $userprofileAppProfileDBName `
                          -ProfileSyncDBName $userprofileAppProfileSyncDBName -SocialDBName $userprofileAppProfileSocialDBName `
                          -Name "User Profile Service Application" -SiteNamingConflictResolution "None" -Verbose)
}

# Create application proxy
$proxy = (Get-SPServiceApplicationProxy | ? { $_.Name -like "User Profile Service Application Proxy" } )
if( $proxy -eq $null ) {
  $proxy = (New-SPProfileServiceApplicationProxy -DefaultProxyGroup -Name "User Profile Service Application Proxy" -ServiceApplication $userProfileSvcApp)
}

 

During the creation of the User PRofile Service Application the MOSS database will be migrated!!

If you did no restore previously the profile database will be created in this step.

4. The farm account must be local admin on the farm server.

5. Go into the SQL Server Management Studio.

6. Set the farm account – in my example “sp_farm” – as SYSADMIN in your SQL Server instance.

7. Edit the User Logins for the (migrated) profile database.

The farm account should exist as login. – If not: add the account as “db_owner”.

Important: Set the schema for the farm account to “dbo”!

8. In the Windows Services Manager (Server Manager): restart a services that has the farm account as identity. OR restart the server!

9. Now: Log on locally with the farm account!! – Yes: logon with the farm account!

10. As farm account: go into the Central Administration –> Manage Services on Server –> Start the User Profile Synchronization service!

11. WAIT!

12. Press F5 on the “Managa Services on Server” page. Maybe wait some more Smile. Have a look into the the SharePoint log. You should find lots of message. Search for “ILM” (using ULSViewer of course).

13. Sometimes – if you are a lucky person – the “User Profile Synchronization” service is startet. – Maybe not. In this case: Start over! – Last time it took me three times to get it working!

14. At the end: remove the farm account from the SYSADMIN group!

[Update / 01/26/2011]

15. Don’t forget to reset the Security Settings (“Administrators”) for the User Profile Service Application after you recreated them. – Go into the Central Administration -> Manage Service Applications -> select your User Profile Service Application -> click “Administrators” in the Ribbon. – You may find this empty!!! This is not correct. Insert here at least the farm account with “Full Control” permissions. And don’t forget to insert the search crawl account with “Retrieve People Data for Search Crawlers” permissions. Otherwise your People Search will not work!

Please give me feedback on this! – The configuration of the User Profile Services Application is a incredible mess.

2 thoughts on “The definitive guide of How to configure the SharePoint 2010 User Profile Service Application

Leave a Reply to Sven Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.