0

So I have on the test SharePoint 2013 server. I have created a number of entries over a number of last few days.

I found about the Remove-SPSocialItemByDate command. The details for the TechNet article are:

https://technet.microsoft.com/en-us/library/ff607934.aspx

I got the GUID for the User Profile application using this

Get-SPServiceApplicationProxy >”E:\backup\output.txt”

Which gives us – e61c84b5-4d79-452c-8025-d0fb90c1d098. I also used another command

$upaSAType = “User Profile Service Application”

$upa = Get-SPServiceApplication | where-object {$_.TypeName -eq $upaSAType}

$upa.id

And that gave me 1ff57208-ee79-4df7-a5d2-07dd2ca6164a but when I run using the 1ff57208-ee79-4df7-a5d2-07dd2ca6164a I get the following error:-

Remove-SPSocialItemByDate -RemoveComments $True -ProfileServiceApplicationProxy 1ff57208-ee79-4df7-a5d2-07dd2ca6164a -EndDate 9/5/2016

Remove-SPSocialItemByDate : Value cannot be null.

Parameter name: applicationProxy

At line:1 char:1

+ Remove-SPSocialItemByDate -RemoveComments $True -ProfileServiceApplicationProxy  …

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo          : InvalidData: (Microsoft.Offic…moveSocialItems:SPCmdletRemoveSocialItems) [Remove-SPSocialItemByDate], ArgumentNullException

+ FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.SPCmdletRemoveSocialItems

Prior to this I was getting the error

UserProfileApplicationProxy.ApplicationProperties ProfilePropertyCache does not have <GUID>

And found this article

http://sharepoint.stackexchange.com/questions/125798/userprofileapplicationnotavailableexception-logging-userprofileapplicationpro

which at least got me to the next error message.

When I use the User Profile GUID as

Remove-SPSocialItemByDate -RemoveComments 1  -ProfileServiceApplicationProxy e61c84b5-4d79-452c-8025-d0fb90c1d098 -EndDate 9/5/2016

I keep getting the error

PS C:\Windows\system32> Remove-SPSocialItemByDate -EndDate 09/05/2016 -ProfileServiceApplicationProxy e61c84b5-4d79-452c-8025-d0fb90c1d098 -RemoveComments $True -RemoveRatings $True -RemoveTags $True -ErrorAction Continue -Verbose -WarningAction Continue

VERBOSE: Leaving BeginProcessing Method of Remove-SPSocialItemByDate.

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.

At line:1 char:1

+ Remove-SPSocialItemByDate -EndDate 09/05/2016 -ProfileServiceApplicationProxy e6 …

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo          : InvalidData: (Microsoft.Offic…moveSocialItems:SPCmdletRemoveSocialItems) [Remove-SPSocialItemByDate], SqlException

+ FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.SPCmdletRemoveSocialItems

VERBOSE: Leaving ProcessRecord Method of Remove-SPSocialItemByDate.

VERBOSE: Leaving EndProcessing Method of Remove-SPSocialItemByDate.

Based on that example I have tried removing tags comments and ratings but am getting stumped with the error message.

I searched for the error but am getting something to do with the SQL queries which is not going anywhere.

https://connect.microsoft.com/SQLServer/feedbackdetail/view/420856/intermittant-query-processor-could-not-produce-a-query-plan-error-when-merge-hash-join-hint-provided-in-the-query

I saw some of the solutions but don’t think it’s the correct one.

http://sharepoint.stackexchange.com/questions/105707/removing-newsfeed-comments-with-remove-spsocialitembydate-throws-sqlexception

https://social.technet.microsoft.com/Forums/office/en-US/25edad36-1c6e-4964-9256-5be32c9f2a25/removespsocialitembydate-query-processor-could-not-produce-a-query-plan-because-of-the-hints?forum=sharepointadmin

Anyone go any idea on this? Please do let me know and thanks in advance.

(Visited 154 times, 1 visits today)
assist4 Answered question May 27, 2020
Add a Comment