Follow the steps outlined below to restore Membership information synchronization between content database and profile database for all site collections.
Warning:
- During this procedure all current SharePoint Group related membership information will be deleted from the Profile database and users will not be able to see their complete 'Membership' information until the "User Profile to SharePoint Full Synchronization job" processes all site collections successfully.
- The following timer job should be disabled while the steps are performed:
"{UPA} User Profile to SharePoint Full Synchronization" job where {UPA} is the name of your User Profile Service Application.
Open SharePoint 2010 Management Shell on the machine hosting the Central Administration as a local administrator user who is also a member of the farm administrators group and has 'Full Control' permissions on the User Profile Service Application.
Replace the url in the first line of the following Powershell script snippet to one of your affected site collections (this code snippet only needs to be executed once and will remove current membership groups from the User Profile Application)
$url = "http://server/sites/sitecoll";
$SPSite = get-spsite $url;
$context = [Microsoft.SharePoint.SPServiceContext]::GetContext($SPSite)
$manager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager $context
$sourceMethod = [Microsoft.Office.Server.UserProfiles.MemberGroup].getmethod("get_Source")
$deleteMethod = [Microsoft.Office.Server.UserProfiles.MemberGroup].getmethod("Delete")
foreach ($memberGroup in $manager.GetMemberGroups())
{
if ($sourceMethod.Invoke($memberGroup, @()) -eq "SharePointSite")
{
$deleteMethod.Invoke($memberGroup, @())
}
}
Once this PowerShell script completes, please run the following command to schedule new synchronization for the content databases.
Stsadm -o sync -deleteolddatabases 0
Now run the following Powershell script to schedule a 'Full Membership Synchronization' of all site collections in your farm.
Get-SPSite -limit all | % {[Microsoft.Office.Server.UserProfiles.WSSProfileSynch]::ScheduleSiteForFullSynchronization($_); $_.Close()}
Post this, follow the steps listed below
- Open Central administration, click on 'Review job Definitions' page under the 'Monitoring' section
- Locate the Timer Job "{UPA} User Profile to SharePoint Full Synchronization" job where {UPA} is the name of your User Profile Service Application.
- Click on the Job's title and click 'Run now'.
- Once the job completes, the membership information will be up-to-date and will be synchronized automatically during subsequent runs for previously affected site collections.