Wednesday, December 9, 2009

SharePoint User Profiles and Properties error

I recently encountered an issue with the Shared Services Administration page for User Profile and Properties (the page where you schedule an Active Directory profile import).

The page in question is in the Shared Services Provider site, e.g. http://server:port/ssp/admin/_layouts/ProfMain.aspx

The error that gets displayed is:
An error has occurred while accessing the SQL Server database or the Office SharePoint Server Search service. If this is the first time you have seen this message, try again later. If this problem persists, contact your administrator.


The error was odd, because I knew SharePoint Search was functioning (search crawls were running as normal, and search queries were being filled in the web front end). After a bit of investigation, I found the following table to be missing some records that were required.

So in actual fact, the error being referred to when accessing the SQL Server database was that some expected records weren't in the table being looked up, not that the database itself is not available.

The table to look into is named MIPScheduledJob, and is located in the Shared Services Provider's "Services" database. The table typically (with this instance of MOSS 2007 SP2, at least) contains 6 records. Two of these records are required for the Profile Import configuration page, and the remaining 4 are related tasks for processing Distribution List and Audience information.

The two key records for the User Profile and Properties page to work can be inserted back into the database with the following SQL INSERT statement:


INSERT INTO MIPScheduledJob (JobId, Assembly, Class, Recurrence, JobData, NextDueTime, Disabled, DisplayName)
VALUES (
'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx',
'Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c',
'Microsoft.Office.Server.UserProfiles.UserProfileImportJob',
'weekly between fri 15:00:00 and fri 15:00:00',
'IsIncremental#False',
'9999-12-31 23:59:59.997',
1,
'User Profile Full Import Job'
)

and

INSERT INTO MIPScheduledJob (JobId, Assembly, Class, Recurrence, JobData, NextDueTime, Disabled, DisplayName)
VALUES (
'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx',
'Microsoft.Office.Server, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c',
'Microsoft.Office.Server.UserProfiles.UserProfileImportJob',
'daily between 12:00:00 and 12:00:00',
'IsIncremental#True',
'9999-12-31 23:59:59.997',
1,
'User Profile Incremental Import Job'
)


Now, you will notice that the JobId values there are in fact of a GUID data type, and these vary per SharePoint instance. You need to look them up in another table, which hopefully still has the appropriate record intact. The table to look up is MIPObjects, and you will find a record in there which has a very large XML data set. If you copy the XML data set out, you will find it contains a number of "field" XML nodes that include GUIDs. Find the two field nodes that correspond to the name of the jobs, i.e.

  <field name="profileFullImportJobId" type="guid">a663ee08-2acd-4ccd-be93-440bc60e4728</field>
<field name="profileIncrementalImportJobId" type="guid">f525c7ec-7f23-4881-acb6-12c5eb9248e4</field>

Grab those GUIDs and put them in the INSERT statements above, run against your SQL server.

Before you execute the INSERT statements, be sure to take backups of your database. And bear in mind that directly modifying data in your SharePoint tables is not supported by Microsoft.

After inserting the records, be sure to go back into the User Profile and Properties page and check the scheduling of the full and incremental profile imports, and adjust accordingly. The data specified in the above INSERT statements I believe, specifically the Recurrence field, is in entered without time zoning applied, so depending on where you are in the world, the scheduling may be INSERTed at innapropriate times.

2 comments:

  1. I just found this page -- I accidentally deleted SIX timer jobs. I was able to restore the two you listed above, but I'm not sure how to restore the other four...I don't know where they live. Here's what I accidentally deleted -- if you can offer any assistance, I'd really appreciate it!

    SSP Timer Job Id="8deb1f24-5ee7-4546-b5ac-5a3df462b2ee" Display Name="User Profile Change Cleanup Job"

    SSP Timer Job Id="4ac0046a-59a7-4ccf-a3b3-c0ab513857d8" Display Name="Audience Compilation Job"

    SSP Timer Job Id="a92e2d59-a955-48c6-955c-d6c375cc7448" Display Name="Distribution List Import Job"

    SSP Timer Job Id="fd953522-17d7-4b80-83f2-f0dec38fed43" Display Name="User Profile Change Job"

    ReplyDelete
  2. What a man you are... Many Many thanks!!! it worked like anything...

    ReplyDelete