Monday, December 26, 2016

SharePoint 2013 People Picker: Sorry, we’re having trouble reaching the server.

Sorry, we’re having trouble reaching the server.

 
 
 
Above mentioned error starts emerging on a SharePoint portal when your domain is not registered as Active Directory domain in people picker control for that specified portal.
 
To add domain to work with people picker run the following PowerShell command as Administrator.
 
 
$webApp = Get-SPWebApplication https://<web adderss>
$newdomain = new-object Microsoft.SharePoint.Administration.SPPeoplePickerSearchActiveDirectoryDomain
$newdomain.DomainName ='<Domain Name like domain.com>'; 
$newdomain.ShortDomainName ='<net bios name (optional)>';
$newdomain.LoginName ='domain\Farm Account'
$newdomain.IsForest='false'
$webapp.PeoplePickerSettings.SearchActiveDirectoryDomains.Add($newdomain)
$webapp.update()
 
To verify if domain has been added, run the command below
 
$webapp.PeoplePickerSettings.SearchActiveDirectoryDomains
 
Wait for couple of minutes and users will start to show in people picker which were initially not showing up.