4

I have a SharePoint 2010 document library in which I have enabled ratings. During testing, several people rated a number of documents, and now I'd like to reset all the documents back to zero. However, I cannot find a way to reset the ratings.

Things I've tried:

Disable ratings and re-enable: The ratings are still there.

Disable ratings, wait 24 hours, and re-enable ratings: The ratings are still there.

Using PowerShell and the SocialRatingManager, attempt to reset the rating (http://www.sharemuch.com/2011/03/22/resetting-sharepoint-2010-social-rating-using-powershell/): The script runs, but nothing changes.

Using the script above, modified to try to do a Delete() method on the rating result: "Attempted to perform an unauthorized operation", even though I am running the SharePoint Powershell as Administrator, logged in as a site admin.

It seems like the last option should be the one to work, but I can't seem to get access to delete someone else's social ratings. Any input would be appreciated.

0

You could try using the RunWithElevatedPriviliges method to run the code as the farm account:

[Microsoft.SharePoint.SPSecurity]::RunWithElevatedPrivileges( 
    {
         # put your PS script here
    }
) 
  • Thanks. No go. First script still runs without changing anything and the Delete method still gets unauthorized. – Randy Slavey May 9 '14 at 16:09
  • Looking at the MSDN info for those classes, it looks like it only allows you to manage ratings for the current user. You could impersonate users (sharepointdeveloperhq.com/2009/04/… is a C# example you could translate into PowerShell). – John Chapman May 9 '14 at 16:31
  • Modified code to run as the owner of the rating. Verified by using "CurrentUser" that the owner of the rating was the one opening the rating. Ran the "DeleteRating" command. Just as before, did not error out, but did not delete the item either. Using the "Delete()" command instead still gave me the "unauthorized" result. – Randy Slavey May 9 '14 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.