Not sure, If I can post it as an answer...Please let me know if that is not the case.
Issue:
Memberships section on My Site's My Profile section is empty and is not showing user as being a member of recently added sites.
Solution:
Memberships list is populated by the User Profile Service Application - User Profile to SharePoint Full Synchronization Timer Job which by default runs once per hour. You can change the schedule or run it manually.
Timer Job:
User Profile Application - User Profile to SharePoint Full Synchronization, is responsible for the below
Description
Synchronizes user information from the user profile application to SharePoint users and synchronizes site memberships from SharePoint to the user profile application.
Duration
Hourly
Links:
http://blog.jussipalo.com/2010/03/sp2010-my-site-memberships-not-showing.html
http://blogs.msdn.com/b/jorman/archive/2009/07/30/my-sharepoint-sites-memberships-general-overview-on-how-this-functionality-works.aspx
http://technet.microsoft.com/en-us/library/cc678870.aspx
Transcript from the above blog post:
@libbyrome - Took a quick look and at first glance that does appear to be the same situation for SharePoint 2010.
I didn't get any sites in Memberships until I explicitly added my account to the Members group for the site. Which means that user belongs to other groups will not be taken into consideration.
In our environment
I added myself into the Members group but still it does not show up in the Memberships list in Mysite.
So examined the sync between the UPS and content DB and amazed, most of the Content DBs are out of sync since a month.
stsadm -o sync –listolddatabases
It has been fixed now.
Where am I stuck?
so, the User Profile Application - User Profile to SharePoint Full Synchronization timer job synchronizes user information from the user profile application to SharePoint users and synchronizes site memberships from SharePoint to the user profile application. But how does Mysite display the Membership information? does it directly query against the UPS? I doubt..any help?
Update:
considering IsActiveUser flag, do user need to perform any activity? User Profile Quick Sync works and it updates the user information in the site collection ane User Profile to SharePoint Full Sync is also done...but still it does not show the membership..even I tried to enumerate the users membership using the UserProfile, still the membership does not seem to be updated...
and how to make sure that the timer job "User Profile to SharePoint Full Synchronization" gets the membership information from my Site collection?
Update:
Find Last change token ID
use SharePoint_Config
SELECT Objects.Id from Objects with(NOLOCK) where Name = 'WSS_Content_80'
O/P:
41950B65-9EBC-41B8-B5A5-4CC961FF6D72
User Profile DB
select CurrentChangeToken from ContentDBSynch with(NOLOCK) where ContentDBID = '41950B65-9EBC-41B8-B5A5-4CC961FF6D72'
O/P:
1;0;41950b65-9ebc-41b8-b5a5-4cc961ff6d72;634434498692430000;2078
so, the change token id is 2078
Last Change Token in Content DB
select * from EventCache with(NOLOCK) where Id > 2078 and ObjectType = '128' or Id > 2078 and ObjectType = '1' or Id > 2078 and ObjectType = '256'
so, the last event change ID is
2011-06-12 04:31:09.243 2078 FC6C1355-F8B1-4C9A-ABF6-6F167C6A1A6E EF582CE4-8281-49F4-93D8-59A7C1E82C08 538EA784-DF6E-4B9C-9F51-7AAA39C9BC87 3
3D4847B3-F051-46DC-AC63-2697CA6B2A4B NULL NULL NULL NULL ESSSharePoint2007 Lists/DiskSizeFind/3_.000 1048576 1 SHAREPOINT
\Administrator 2011-06-12 04:31:09.000 NULL
0xF3FE000001000000000000000400000001000000001001083000000003000000FFFFFFFFFFFFFF7F0400000061104308B000000005000000EF12433CB0010000
so, content DB and Profile DB are in Sync - 2078.
Now, Add a new User into the Member group on the site collection
Run the query again
Last Change Token in Content DB
select * from EventCache with(NOLOCK) where Id > 2078 and ObjectType = '128' or Id > 2078 and ObjectType = '1' or Id > 2078 and ObjectType = '256'
O/P:
2011-07-09 03:30:04.440 2080 FC6C1355-F8B1-4C9A-ABF6-6F167C6A1A6E EF582CE4-8281-49F4-93D8-59A7C1E82C08 B55DD853-40C6-4996-8490-B800E5195063 8
7E7CC0AE-B6FC-4FD7-9E0D-904E0127D445 NULL NULL NULL NULL Karthik catalogs/users/8.000 4097 1 SHAREPOINT\Administrator 2011
-07-09 03:30:04.000 NULL NULL
So the last change token has been updated - 2080
EventCache table is used to capture all kind of Events on the site collection.
Go to users Mysite - Membership, you will find nothing.
Run the Profile Sync job using the below command
stsadm -o sync
Now, Again find the lastest change token
User Profile DB
select CurrentChangeToken from ContentDBSynch with(NOLOCK) where ContentDBID = '41950B65-9EBC-41B8-B5A5-4CC961FF6D72'
O/P:
1;0;41950b65-9ebc-41b8-b5a5-4cc961ff6d72;634457818556070000;2080
So the change has been updated.
Content DB and Profile DB are in Sync - 2080.
Alternative method
if not still you can kick-off the profile sync job by running follow command
stsadm -o sync -synctiming M:1
Find the User's System ID (Unique in the Farm)
Content DB:
select distinct tp_SystemID from dbo.UserInfo where tp_Login like '%karthik%'
O/P:
0x010500000000000515000000666957F2C7B6F1B5F04C42E15F040000
Find his Membership groups ID
User Profile DB
select Distinct MemberGroupId from UserMemberships where
UserMemberships.SID =
0x010500000000000515000000666957F2C7B6F1B5F04C42E15F040000
O/P:
24
Find his Membership groups
User Profile DB
select Id, DisplayName, Url, MemberCount from MemberGroup with(NOLOCK) where Id = '24'
O/P:
24 Test http://esssharepoint20/Test 2
Now, go to his Mysite - Memberships page you should be able to see this URL over there.
Findings:
The Members group should have atleast a user at all time.
If you remove all of the users from the "Members" group it will remove the "MemberGroupId" from the table "MemberGroup" and seems to can't create a new ID again even if you add a new user back to the Members group.
You may add/remove the user from the Members group and it will be taken into account during next "Profile Sync".
Create a new subsite under the site/subsite where membership is not getting populated, add a user and wait for a sync to complete, you should be able to find this subsite URL on the Memberships list next time.
User may belongs to any group that does not matter however you should be a member of Members group.
It considers only the default (OOB) Members group but not the custom groups with contribute permission.
Deleted the OOB Members group and created a new (custom) Members group, added few users, run the sync command however SSP did not pick it up.
But still I could not find the answer for the below questions:
1. How I could resolve if Content DB is in sync with ProfileDB and still not showing/populating the Membership?
2. How I could resolve if it is populating few users and not others?
3. Does it consider the Members group if the site collection is created after the Profile Sync run atleast once before?
It seems to be a long way to go...any help? Looking for part-2 link as part-1 is available here: http://blogs.msdn.com/b/russmax/archive/2010/12/23/sharepoint-2007-unraveling-the-mystery-of-mysite-site-membership-population-part-1.aspx