Whilst working on a small piece for a client to allow their users to create personal sites, I encountered an interesting error with a fairly simple and understandable fix. But i wasted around an hour before I twigged what the issue was, so I figured it’s worth documenting here!
For this client, the SharePoint server exists in one domain, and the users all now exist in a new domain that they were migrated to. Access to SharePoint is provided by way of a two way domain trust.
I had finished configuring the MySites host and had tested ok using local accounts in the SharePoint domain, but I hit an issue when creating the personal sites in PowerShell for the users in the trusted domain.
And in the ULS logs we could see several errors against the user whose personal site I was trying to create.
Failed to create personal site (DOMAIN\username, https://obscuredurl/personal/username): Microsoft.SharePoint.SPException: User cannot be found.
at Microsoft.SharePoint.Administration.SPSiteCollection.Add(SPContentDatabase database, SPSiteSubscription siteSubscription, String siteUrl, String title, String description, UInt32 nLCID, String webTemplate, String ownerLogin, String ownerName, String ownerEmail, String secondaryContactLogin, String secondaryContactName, String secondaryContactEmail, String quotaTemplate, String sscRootWebUrl, Boolean useHostHeaderAsSiteName)
at Microsoft.SharePoint.SPSite.SelfServiceCreateSite(String siteUrl, String title, String description, UInt32 nLCID, String webTemplate, String ownerLogin, String ownerName, String ownerEmail, String contactLogin, String contactName, String contactEmail, String quotaTemplate, SPSiteSubscription siteSubscription)
at Microsoft.Office.Server.UserProfiles.UserProfile.<>c__DisplayClass2.<CreateSite>b__0().
Luckily, once I realised what was going wrong the fix was quite simple, however it needed a little bit of STSADM as the people picker still doesn’t exist in PowerShell yet! All we had to do was tell the PeoplePicker for the MySites host to search the other trusted domain. (I should have remembered this, as I had to do it for the main web applications when we migrated the users to the new domain some time ago!)
The details for this are available at https://technet.microsoft.com/en-us/library/cc263460.aspx
Once this was set-up the creation of personal accounts worked just fine.
Paul.