Get All Social Comments in SharePoint (For Admins, or Lazy Devs)

Oh guess what, Social comments are known as Notes not comments, because well SharePoint. I had a requirement to get a list of all the comments on a specific news story. (Publishing Story) I was looking for ways to accomplish this and I know that comments are stored not in the content database, but in the User Profile Social Database.  (At first I was like why in the world? And of course this will introduce other problems, but I can kinda see why now, so just roll with it. Although one of those problems could be, how can you retrieve user comments on a farm where you’re only restored the content database, but not the UPS databases? ) Anywho, I was trying to accomplish this with PowerShell, but wasn’t getting much traction. I saw there were some Social Comment controls out there, but I didn’t want to create a new page layout. There’s some methods to create this programmatically with CSOM, but being an admin who occasionally ventures into the developer world I was really struggling with how to get all those square shapes into those round puzzle holes. So I did something you should never do. I queried the database directly.  (I know I know, and I’m also not insane.) I had a copy of the database moved to a test farm and queried the database that way. 🙂...

Read More