So, if you have a SharePoint 2007 Shared Services Provider and are syncing user profiles with your AD then you might do something stupid like accidentally deleting the TimerJobs that do the profile sync and clean up and what have you.
So now, you’re getting An error has occurred while accessing the SQL Server database or the Office SharePoint Server Search service. errors in your SSP admin and your profiles aren’t syncing and it’s all something of a mess.
Now, it’s already documented in a couple of places how to fix the Full & Incremental profile import jobs, notably here: http://www.geekinthepink.info/2009/12/sharepoint-user-profiles-and-properties.html but what if you’ve been really dumb and deleted the other jobs too? Well I’ve included the required SQL below to recreate all 6 of the core jobs, but it does require a little work on your part; you need to look up the GUIDs from the MIPObjects table in the main SSP Database (e.g. SharedServices_DB), which is the same database that you need to run this script against. In it, you will hopefully find a record which has an XML data set that probably starts with something like:
<object><field name="canonicalMySitePortalUrl" type="string">... |
If you copy the XML data set out, you will find it contains a number of “field” XML nodes that include GUIDs. Find the nodes that correspond to the name of the jobs i.e:
<field name="profileChangeJobId" type="guid">f4e31424-0361-45f2-98d6-0150b74e6345</field> <field name="profileChangeCleanupJobId" type="guid">becd5baf-ca7e-4c1b-9c1a-0db941337b55</field> <field name="profileFullImportJobId" type="guid">5c6d0eb4-1880-44e6-9b0a-6704f5393fde</field> <field name="profileIncrementalImportJobId" type="guid">3128d33d-23e5-4d85-af00-26f90f760d0a</field> <field name="DLImportJobId" type="guid">77b77902-4fb5-48b4-a709-6f0f8d167a1b</field> <field name="audienceCompilationJobId" type="guid">7a1dcf14-fe06-40ab-82c7-d8f7e72f5fdf</field> |
And insert the GUID values into the SQL below for each appropriate job, replacing the xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx placeholders. Do not just use the ones in this example, they won’t work as they’re unique to each SharePoint instance
You can also obviously change the schedules and the NextDueTime values to suit your own environment.
And next time, take backups
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.UserProfileChangeJob', 'hourly between 0 and 0', '', '2012-10-31 15:00:00.000', 0, 'User Profile Change Job' ) 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.UserProfileChangeCleanupJob', 'daily between 21:00:00 and 21:00:00', '', '2012-10-31 15:00:00.000', 0, 'User Profile Change Cleanup Job' ) 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.DLImportJob', 'every 5 minutes between 0 and 0', '', '2012-10-31 15:00:00.000', 0, 'Distribution List Import Job' ) 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.Audience.AudienceCompilationJob', 'daily between 01:00:00 and 01:00:00', 'NULL', '2012-10-31 15:00:00.000', 0, 'Audience Compilation Job' ) 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', '2012-10-31 15:00:00.000', 1, 'User Profile Full Import Job' ) 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', '2012-10-31 15:00:00.000', 1, 'User Profile Incremental Import Job' ) |