Nearly everything can be configured through PowerShell but not everything makes us really happy.

Three Accounts are recommended:
Domain\SPFarm; local Admin on the SharePoint Server
Domain\SPAppPool; has “Run as service” on SharePoint Server
Domain\SPDirSync; has the AD permissions for the replication

Logged in as Domain\SPFarm and with three lines of PowerShell we can configure the UPA:

Start the PowerShell ISE as Machine Administrator and run the following three lines one by one.

  1. $pool = Get-SPServiceApplicationPool -Identity "SharePoint Web Services Default"
  2. $UPA = New-SPProfileServiceApplication -ApplicationPool $pool -name "UPA" -ProfileDBName "UPAProfileDB" -SocialDBName "UPASocialDB" -ProfileSyncDBName "UPASyncDB"
  3. $proxy = New-SPProfileServiceApplicationProxy -DefaultProxyGroup -ServiceApplication $UPA

After that the UPA gets the name “UPA”, the profile database gets "UPAProfileDB", the social database gets "UPASocialDB" and the profile sync database gets "UPASyncDB". You might need to check that on the SQL server these names are not yet engaged or please use your own names for the databases.

Next step is on the page where you have a view on “Services on Server” to start the “User Profile Synchronization Service” and use the drop-down box to choose “UPA” and the password for the Farm Account to configure that. It will take some time before this service will be Started and will never be Started in case something earlier configured stuff went wrong.

After that service has the Started status configure the Connection for the UPA. This should be also straight forward and I used the UI for that; use Domain\DirSync for the connection.

Last but not least start the full synchronization.

The following three PowerShell lines you can use when you have to create a MultiTenant Farm:

$pool = Get-SPServiceApplicationPool -Identity "SharePoint Web Services Default"
$UPA = New-SPProfileServiceApplication -ApplicationPool $pool -name "UPA" -ProfileDBName "UPAProfileDB" -SocialDBName "UPASocialDB" -ProfileSyncDBName "UPASyncDB" -PartitionMode
$proxy = New-SPProfileServiceApplicationProxy -PartitionMode -DefaultProxyGroup -ServiceApplication $UPA

Next steps might be different to the steps above.