HOWTO Manually Delete Activity Feeds from the SharePoint 2010 User Profile Database

WARNING: This process directly updates the SQL Server database used to host user profiles. It is not supported by Microsoft, and you may inadvertently damage your SharePoint environment following these steps. But if you absolutely have to…

We had a case where some data was inadvertently added to the User Profile activity feed on a users MyS ite and it contained potentially “your-eyes-only” information. It had to be removed ASAP, and OOTB there is no function with SharePoint that lets you directly individual items in the activity feed.

Normally, SharePoint 2010 uses two timer jobs to manage activity feed entries in the User Profile database:

<user profile service app> - Activity Feed Job  (used to push data into the activity feed)
<user profile service app> - Activity Feed Cleanup Job (used to delete activities once they are > 14 days old)

The second job looked promising originally as it is in the SharePoint 2010 CA, but it is not configurable and  hard-code to 14 days. However that job is attached to a stored procedure in the user profile database:


which deletes records from the table [ActivityEventsPublished]. I opened SQL management studio and viewed the entries for that table, and sure enough I found the ‘offending’ activity feed entry.

In this particular case I decided to delete the entry manually via SQL server using the T-SQL command:

delete from [ActivityEventsPublished]

where  ActivityEventId = <id>

This instantly removed the activity feed record and disappeared from the users activity feed straight away.

The only “supported” way I can think to do this would be:

  1. Wait the 14 days and let the activity feed be deleted via the timer job
  2. Restore a previous copy of the User Profile database

Neither way was good for the business users, so I chose the technically more perilous road instead…


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: