Hi Team,
I have been working on the below script to delete all social data from the sharePoint application before it goes live.
Pls find my code below.
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell" } $todaysdate=Get-Date -format d $userProfProxy = Get-SPServiceApplicationProxy | where { $_.DisplayName -eq 'User Profile Service Application' } Remove-SPSocialItemByDate -RemoveComments 1 -ProfileServiceApplicationProxy $userProfProxy -EndDate $todaysdate Remove-SPSocialItemByDate -RemoveTags 1 -ProfileServiceApplicationProxy $userProfProxy -EndDate $todaysdate Remove-SPSocialItemByDate -RemoveRatings 1 -ProfileServiceApplicationProxy $userProfProxy -EndDate $todaysdate Write-Host -f green "Social Feed, Tags and comments deleted for users"
I am getting the below error.
Remove-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.
Thanks Ba$va