Incorrect search result title for Word 2007 documents in SharePoint 2010 search

I have set up our SharePoint 2010 platform and when we were about to migrate our SharePoint 2007 sites and contents into the new platform, we noticed that the document titles are showing incorrectly in SharePoint 2010 search results for documents created with MS Word 2007. When I tested it more with a bunch of documents created with Word 2007, it was observed that actually search was picking up first fiew readable words within the document instead of picking document title (metadata) or filename if there is no title for the document. It looks like a new feature that MS added into SharePoint 2010 search. We have like 1000s of documents created with MS Word 2007 in our MOSS 2007 production which need to be migrted to new SharePoint 2010. This new feature almost make the search results unusable becuase the search result will show first few words from within the document and most of the documents will have the text “Table of Contents” as first readable normal text in the document. Just to test, I created some documents in Word 2007 providing the document title inside first page of the document in big bold letters and for some reason, search was omitting those text in big bold letters.

Fortunately, before we start migrating stuff from MOSS 2007, we found out a workaround for this. Even though Microsoft has not provided an option within SharePoint to turn this feature off, the configuration is kept inside Windows registry. It can be changed by performing the following steps in the app searver running SharePoint Search Service.

  1. Open registry for editing by typing “regedit.exe” in Start > Run
  2. Navigate to the key [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\14.0\Search\Global\Gathering Manager]
  3. Change the hexadecimal value for EnableOptimisticTitleOverride to 0 (zero) on the right hand side.
  4. Restart SharePoint Search service by typing the following commands in command prompt.
    • net stop osearch14
    • net start osearch14
  5. Perform a full crawl

After the full crawl, document title will be displayed in search resutl for Word 2007 documents just like Word 2010 documents. I haven’t done much testing to check the consequeces of the registry change mentioned above.

Update [7-Apr-2011]: Confirmed with Microsoft that it is a valid workaround and it will not cause any issues with Search service. Microsoft is already working on a KB article describing this fix. Thanks to Thomas McDaniel (Senior Premier Field Engineer, Microsoft) for confirming this.

Changing logical names and physical file names of SQL Server database

The easy way of renaming a SQL Server database is to open SQL Server Management Studio, select the database name on the tree on the left handside, hit F2 and type in the new name you want. It’s like renaming a file in a folder. But when you do that, the logical name and physical filenames of the database won’t change. In order to verify this, right click on the database name, select properties. Select Files sction on the left hand side. You can see the logical name and file name for data and log files on the right hand side.

Before attempting to change the names, you should take the database offline. You can do that using SQL Management Studio (right click the database and select Tasks > Take Offiline) or using the following SQL steatement.


ALTER DATABASE <em>database_name</em> SET OFFLINE

In order to change the logical name, execute the following T-SQL statement in a new query window for the database in SQL Server Management Studio. You can use the same statement for both data and log files by changing current_logical_name and new_logical_name.


ALTER DATABASE <em>database_name</em> MODIFY FILE (NAME=<em>"current_logical_name"</em>, NEWNAME=<em>"new_logical_name"</em>)

In order to change the physical file names, execute the following T-SQL statement. You can use the same statement for both data and log files by changing the logical_name and new_file_name.


ALTER DATABASE <em>database name</em> MODIFY FILE (NAME=<em>"logical_name"</em>, FILENAME=<em>"C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\new_file_name_you_want.mdf")</em>

The data and log file location may change depending upon your SQL Server installation.

After executing the SQL statements and before bringing back the database online, go ahead and change the file names for data and log files (.mdf and .ldf) to new_file_name in the file system. Now you are good to go. Go ahead and bring the database online.

You can do that using SQL Management Studio (right click the database and select Tasks > Bring Online) or using the following SQL steatement.


ALTER DATABASE <em>database_name</em> SET ONLINE

Changing PerformancePoint Services 2010 Database Name

[UPDATE – 2/23/2012]: Installing Service Pack 1 introduced the option to specify database name while creating PerformancePoint Service Application.

Creating PerfomancePoint service application in SharePoint 2010 is still a nightmare to SharePoint administrators especially when the DBAs are not big fans of GUIDs in database names. No matter we use Central Administration or PowerShell for creating PerformancePoint Service application, we don’t have any control over naming the database. It creates the PerformancePoint Service database with a name like “PPS_application_name_GUID”. But there is a workaround for changing the database name once the service application is created. Following steps describe this.

1. Stop PerformancePoint Service in Central Administration > Manage services on server

2. In the database server, using SQL Server Management Studio, back up the PerformancePoint Service database (one with the GUID in name)

3. Restore the backup into the same database server with a new name (according your naming convention). If you want to change the logical name and physical file names, you can do that as well. I have explained those steps in another post.

4. In one of the application servers, open SharePoint 2010 Management Shell (PowerShell) console and provide the following PowerShell commands.

$dbname = “name of restored database”

Set-SPPerformancePointServiceApplication -Identity “name of PerformancePoint Service application instance” -SettingsDatabase $dbname

5. Restart PerformancePoint service through Central Administration > Manage services on server.

6. Delete the old database from the server. Before deleting the database, it’s good take it offline and make sure PerformancePoint Services features are still working properly.

Error with per-user identity option in PerformancePoint Services 2010

I have configured PerformancePoint Services in my SharePoint 2010 Enterprise platform. Everything was configured correctly including Unattended Service Acount. But for some reason, I was getting errors while creating a data source from a SharePoint list in the same site collection using per-user identity option selected. It was working fine with Unattended Service Accoutn option. It was also logging the following error into Windows event viewer.

Event ID: 37
The following data source cannot be used because PerformancePoint Services is not configured correctly.

Data source location: http://siteurl/Data Connections for PerformancePoint/2_.000
Data source name: New Data Source

Monitoring Service was unable to retrieve a Windows identity for “domain\username”.  Verify that the web application authentication provider in SharePoint Central Administration is the default windows Negotiate or Kerberos provider.  If the user does not have a valid active directory account the data source will need to be configured to use the unattended service account for the user to access this data.

I was using Integrated Authentication for the web application. After searching for a long time, I found a discussion related to Geneva Framwork (Claims to Windows Token Service) to be running in the server (but that was for using Kerberos authentication with remote SSAS servers). Anyways, I started the Claims to Windows Token Service through Central Administration > Services on Server and bingo, per-user identiy option is working!!!

Error 1327: Invalid drive

While installing device driver for my bluetooth adapter in my Windows 7 computer, I ran into an error (error 1327: Invalid H:\ drive). I have configure a folder called “My Documents” from the network drive H:\ as my primary document folder and I thought that might have caused this error with the installer. I deleted the configuration and disconnected the network drive (H:\) from my computer and executed the driver installer again. Still the same error.

After googling for a short while, I found the solution as follows.

  1. Open regedit.exe (type regedit.exe in Start > Run and hit enter)
  2. Find the key [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
  3. Delete any values which start with the drive letter shown in the error message

SharePoint Designer Workflow Actions using elevated permissions

Some of us might have encountered a situation where we need to copy or move a document (usually InfoPath form) once it is uploaded/submitted by the user to a different library where the user doesn’t have permission. With SharePoint 2007, we used an open source extension to achieve this functionality. With the extension, we were able to copy/move the document from one library to another using the System account privileges. Using the system account privilege in a workflow action of course has its own security issues.

Now, SharePoint 2010 workflow (SharePoint Designer 2010) is out of this hassle. SharePoint Designer 2010 workflow has a new feature called “Impersonation Step”. This is nothing but a workflow step by any actions included in this step will be executed using the Workflow author’s privilege instead of the user who is submitting the document. The Impersonation Step is present in the Insert section of SharePoint Designer ribbon.

Tip:

SharePoint Designer always use the logged in user’s (workflow author) credentials for running the impersonation step. If you are unable to log in to the local computer using the account you want to use for impersonation step, you can run SharePoint designer as a different user using the following method.

  1. Navigate to the folder C:\Program Files (x86)\Microsoft Office\Office14\
  2. Right click the file SPDESIGN.EXE and select ‘Run as different user’ context menu item (you can also create a shortcut to this file on Desktop and right click the shortcut).
  3. Enter the network credentials (or different user account) you prefer to run SPD as.

How to clear file system cache (timer cache) in SharePoint servers?

  1. Stop the Timer service through the Services console.
  2. On the computer that is running Microsoft Office SharePoint Server 2007 or SharePoint Server 2010 and on which the Central Administration site is hosted, open Windows Explorer, locate and then double-click the following folder:

    Drive:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\GUID
    [For Windows Server 2008, the folder location is, Drive
    :\ProgramData\Microsoft\SharePoint\Config\GUID]

    Notes

    • The Drive placeholder specifies the letter of the drive on which Windows is installed. By default, Windows is installed on drive C.
    • The GUID placeholder specifies the GUID folder.
    • The Application Data folder may be hidden. Show hidden files and folders through Windows Explorer’s Folder Options setting.
  3. Back up the Cache.ini file.
  4. Delete all the XML configuration files in the GUID folder. Do this so that you can verify that the GUID folder is replaced by new XML configuration files when the cache is rebuilt.

    Note When you empty the configuration cache in the GUID folder, make sure that you do not delete the GUID folder and the Cache.ini file that is located in the GUID folder.

  5. Open the Cache.ini file in a text editing program.
  6. Delete everything in the file and type 1.
  7. Save and close the file.
  8. Start the Timer service through Services console.

    Note The file system cache is re-created after you perform this procedure. Make sure that you perform this procedure on all servers in the server farm.

  9. Make sure that the Cache.ini file in the GUID folder now contains its previous value. For example, make sure that the value of the Cache.ini file is not 1.
  10. Open SharePoint Central Administration site and verify that the Config Refresh entry is Succeeded in the Timer job Status.