I am trying to remove all Mysite newsfeed comments via powershell in preparation for a new site release (getting debugging and test comments out, etc.)...
I am using the Remove-SPSocialItemByDate powershell command (http://technet.microsoft.com/en-us/library/ff607934(v=office.15).aspx) and following multiple examples found there and in the Powershell for sharepoint 2013 How-To... but I consistently get the same error.
code:
Add-PsSnapIn Microsoft.SharePoint.PowerShell
##This script removes comments, ratings and tags made before EndDate value
$userProfProxy = Get-SPServiceApplicationProxy | where { $_.DisplayName -eq 'User Profile Service Application' }
$userProfProxy
Remove-SPSocialItemByDate -ProfileServiceApplicationProxy $userProfProxy -RemoveComments 1 -EndDate 7/1/2014
Error:
Name Type Id
---- ---- --
User Profile Serv... User Profile Serv... 08d859ab-14e6-45a0-80cb-e2c74c312422Remove-SPSocialItemByDate : Query processor could not produce a query plan because of the hints defined in this query. Resubmit the query without specifying any hints and without using SET FORCEPLAN. At line:7 char:1 + Remove-SPSocialItemByDate -ProfileServiceApplicationProxy $userProfProxy -Remove ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (Microsoft.Offic...moveSocialItems:SPCmdletRemoveSocialItems) [Remove-SPSocialItemByDate], SqlException + FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.SPCmdletRemoveSocialItems