Thursday, July 24, 2014

SharePoint 2013 Search: "The server is unavailable and could not be accessed. The server is probably disconnected from the network."

I recently experienced an issue of of a single content source not crawling in the SharePoint 2013 Search Service Application. The crawl log gave the following error:

"The server is unavailable and could not be accessed. The server is probably disconnected from the network."

I had already added the infamous DisableLoopBackCheck fix when I initially deployed the farm, so I knew that wasn't going to be the solution.

The following steps fixed the issue for me:

1) Open the registry on the Central Administration server.
2) Navigate to HKLM\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0.
3) Right-click MSV1_0 and add a new Multi-String Value. Give it a name of BackConnectionHostNames.
4) Double-click to modify the newly created BackConnectionHostNames item. Add the FQDN of each web application you want to crawl, one per line. Select OK.
5) Perform an IIS reset.

Should be able to successfully crawl the content source now.

Tuesday, July 15, 2014

Best Practice: Migrating and converting SharePoint 2010 web applications from Classic-Mode to Claims-Based Authentication in SharePoint 2013

For migrating and converting SharePoint 2010 web applications from Classic-Mode to Claims-Based Authentication in SharePoint 2013, the following steps work best for me:

1. Create new classic-mode web application in SharePoint 2013, using PowerShell.



2. Restore and attach the content database from SharePoint 2010 to SharePoint 2013.



3. Deploy farm solutions as needed on the upgraded web application in SharePoint 2013.

4. Perform an IIS reset on Central Admin server and each WFE server in the SharePoint 2013 farm.

5. Ensure you can access the site collection in default Windows classic mode.

6. If you have a custom security trust config file, manually copy the file from a SharePoint 2010 WFE server to the Central Admin server and each WFE server in the SharePoint 2013 farm. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG.

7. If you perform step 6 above, you will also need to manually add the open and closing security policy tag to the web.config file on the Central Admin server and each WFE server in the SharePoint 2013 farm, directly under the system.web opening tag.



8. Convert the web application to Claims-Based Authentication.



9. Run the usermigration_Claim.ps1 script, provided by Karim.

usermigration_Claim.ps1

10. Perform an IIS reset on Central Admin server and each WFE server in the SharePoint 2013 farm.

11. Ensure users can successfully access sites in the converted web application.

Wednesday, July 2, 2014

SharePoint 2013: Add user profile properties to People search results

By default, People search results in SharePoint 2013 only shows the Job Title and Department user properties. You can add additional user properties using a custom Display Template by following these steps.

1. On the Search Center site, go to Site Settings, Master pages and page layouts, Display Templates, and Search. Download a copy of the Item_Person.html file to your desktop, and open the file in your favorite editor. In the mso:managedpropertymapping section, add your user properties in the same format as the existing ones. For example, the Mobile Phone user property would be:

'MobilePhone':'MobilePhone'

Be sure to separate all newly added user properties with a comma.

2. In the variable declarations section, add your additional user properties in the same format as the existing ones. For example, Mobile Phone would be:


3. In the section below the variable declarations section, add each additional user property's DIV content in the same format as the existing ones. For example, Mobile Phone would be:


Be sure to add each user property in the appropriate order in this section. So, if you want Mobile Phone to be located after the Work Phone property in People search results, add the Mobile Phone DIV content directly after the Work Phone DIV content.

4. Save and rename the the file to to something specific to your organization, such as Item_Person_Contoso.html.

5. Upload the file to the same location where you initially copied the file (Search Center site, Site Settings, Master pages and page layouts, Display Templates, and Search). Be sure to check in and publish a major version of the file.

6. Edit your peopleresults.aspx page, and then edit the People Search Core Results web part. Expand Display Templates, select Use a single template to display items, and then select your custom Display Template. Save the web part. Check in the peopleresults.aspx page and publish a major version.

Test People search results and ensure the properties are there. All done.

A few notes:

If some of the user properties don't show in the search results, you may have to tweak them a little. In particular, I have noticed the following:

Email = WorkEmail
Mobile Phone = MobilePhone
Office = OfficeNumber

To get the email address to show as a link, add the anchor tag to the DIV content as shown in the example below: