Back to Insights

SharePoint 2010 User Profile synchronization

The rating synchronization does not require the User Profile Synchronization Service started, and just relies on the User Profile Service. The timer jobs required are the "User Profile Service — Social Data Maintenance Job", and the "User Profile Service — Social Rating Synchronization Job." If you are developing an application that uses data from the User Profile databases, then you may be interested in changing the schedule to a more frequent interval for testing purposes, or if there is a requirement to have rating information updated quickly.

From the SharePoint 2010 Central Administration area, navigate to the timer job definitions and set the following timer job schedules:

  • User Profile Service — Social Data Maintenance Job
  • Job Title: User Profile Service — Social Data Maintenance Job
  • Job Description: Timer Job to synchronize rating values between Social Database and Content database
  • Recurring Schedule: Every 1 minutes

  • User Profile Service — Social Rating Synchronization Job
  • Job Title: User Profile Service — Social Rating Synchronization Job
  • Job Description: Timer Job to synchronize rating values between Social Database and Content database
  • Recurring Schedule: Every 1 minutes
  • To verify the status of these timer jobs, you can run the following script in PowerShellL
    (You can use PowerShell ISE, PowerGUI, or other Powershell tools to run these scripts)

    Add-PSSnapin Microsoft.SharePoint.PowerShell
    #List all timer jobs 
    Get-SPTimerJob | Sort-Object Name | Select Name
    #Full details for the selected timer jobs
    Get-SPTimerJob | Where-Object { $_.Name -eq "User Profile Service_SocialDataMaintenanceJob" } | Format-List
    Get-SPTimerJob | Where-Object { $_.Name -eq "User Profile Service_SocialRatingSyncJob" } | Format-List
    #Filtered details for the selected timer jobs
    Get-SPTimerJob | Where-Object { $_.Name -eq "User Profile Service_SocialDataMaintenanceJob" } `
    | Select Title, Schedule, LastRunTime, IsDisabled, Description | Format-List
    Get-SPTimerJob | Where-Object { $_.Name -eq "User Profile Service_SocialRatingSyncJob" } `
    | Select Title, Schedule, LastRunTime, IsDisabled, Description | Format-List
    

    Example Results:

    To elaborate more on how to verify you are getting values, check the Social Database (Social DB) for the User Profile Service that is associated with the web application for the site you are testing. There are three tables that allows us to validate the updates completed: Social Ratings, SocialRatings_Averages, Social_Ratings_ChangeLog

    The database SocialRatings gets updated as soon as you select the "rating stars" from the web site. However, at this point, the website average stars are no updated until the "User Profile Service – Social Data Maintenance Job" timer jobs updates the SocialRatings_Averages databases, which is then reflected on the website. To confirm ratings is working, you verify the entries being added to the Social databases tables.

    SQL (Social DB)

    SocialRatings

    /****** Script for SelectTopNRows command from SSMS ******/
    SELECT TOP 1000 [UrlID]
    ,[User_RecordID]
    ,[Rating]
    ,[Title]
    ,[LastModifiedTime]
    ,[PartitionID]
    FROM [SVRDP_MSS_Social_DB].[dbo].[SocialRatings]

    SocialRatings_Averages

    /****** Script for SelectTopNRows command from SSMS ******/
    SELECT TOP 1000 [PartitionID]
    ,[UrlID]
    ,[AvgRating]
    ,[RatingCount]
    ,[ComputedTime]
    FROM [SVRDP_MSS_Social_DB].[dbo].[SocialRatings_Averages]
    

    Share