Hello and thanks for reading. I've been working with the out-of-box SharePoint 2010 News Feed portion of My Sites, and I am planning to deploy it to many users.
I am building a console application which will iterate through all of the my sites currently in the system and un-check one of the "Activities I am following' for each user. I have used the example provided at
this link(MSDN) to come up with the following code:
Public Class ChangeActivity
Public Shared Sub ChangeActivityProperties()
Using siteCol As New SPSite((My.Application.CommandLineArgs(0)))
Dim context As SPServiceContext = SPServiceContext.GetContext(siteCol)
Dim profileManager As New UserProfileManager(context)
Dim profile As UserProfile = profileManager.GetUserProfile("THEDOMAIN\username")
Dim activityMan As ActivityManager = New ActivityManager(profile, context)
'Create an instance of a list of ActivityPreferencePerType objects.'
Dim activityPrefsPerType As New List(Of ActivityPreferencePerType)(activityMan.ActivityTypes.Count)
View Complete Post