Apr 26, 2013

SharePoint 2010 Search and Search Server Express: slow first search

We had a problem where the initial search with Search Server Express was extremely slow, but subsequent searches were much faster.

The problem was that SharePoint would try to retrieve a root certificate from the internet for the first search from a user.

Here's the fix: http://support.microsoft.com/kb/2639348

Apr 17, 2013

Passing parameters to InfoPath forms in SharePoint 2010

Until SharePoint 2010,  I used two methods to pass parameters to forms in SharePoint:

1. Using Javascript/JQuery to read a URL Query parameter and assign it to the HTML control.  This was error prone due to the difficulty of finding the right control via the "title" attribute and then assigning the value to all the different types of control, especially lookup fields with more than 20 elements.

2.  Using Managed code in InfoPath to read a URL Query parameter and assign it to a node in the InfoPath data tree.  This required publishing the InfoPath form via Central Administration and was rather inflexible.

Thankfully, the InfoPath/SharePoint teams have given us a third option in SharePoint 2010:
  Connecting the Query parameter filter webpart with the InfoPath form webpart. 

This video by Igor Jericevich gives the details: http://youtu.be/tskm5mQ3W3g

Apr 12, 2013

Restoring a SharePoint 2010 content database to a different domain

Much has been said about how to backup and restore a content database to another domain, but I'd like to post my version here to avoid a few gotchas I've come across.

  1. Take original content database offline in Central Administration > Application Management > Manage Content Databases
  2. Connect to SQL Server and make a backup of the original content database.
  3. Put the original content database back online via Central Administration.
  4. Move the database backup file to the new SQL Server.
  5. Restore the database backup file to the new SQL Server via SQL Management Studio.  You can change the database name at this time if you'd like.
  6. In SQL Management Studio > Security > Logins, go to the Properties of the new farm account login (domain\sp_farm or similar) and in the User Assignment panel, give the farm account the "db_owner" role for the new database.
  7. Connect to the Central Administration for the new server farm and create a new web application.
  8. You may create a new site collection and content database if you'd like to check that the new web application is working before restoring the original content database.
  9. If the new web application has any content databases that have site collections in the same URL path as the original content database (usually /), you must go to Central Administration > Application Management > Manage Content Databases in the new farm and remove that database from the web application (not just take offline, but remove).  It's important to remove the old content databases before adding the new content database in order for SharePoint to properly detect the site collection entry points.
  10. Add the restored content database to the new web application.  DO NOT connect to the new web application yet via web or you'll risk a conflict in the user migration steps.
  11. Open the SharePoint PowerShell Administration Console as administrator.
  12. Execute "Get-SPUser -Web http://newWebapplicationUrl" to get a list of all logins for the new web application
  13.  For each login shown that has the "olddomain", execute "Move-SPUser -Identity "olddomain\olduser" -NewAlias "newdomain\newuser". 
  14. Connect to the new web application to validate the restored content.
  15. If a new content database was created with the new web application, you may delete it now via SQL Management Studio.  Be careful not to delete your restored content database.

Apr 9, 2013

SharePoint 2007 and 2010 problems in Internet Explorer 10

Due to a bug in the browser detection files of .NET 2.0 and 3.5, SharePoint doesn't detect IE 10 properly and doesn't activate the necessary scripts and ActiveX.

This Microsoft hotfix (KB 2600100) updates the browser detection files and solves the problem.

These two blogs have more detailed information on the problem and its solution: