2

Our auditData table is growing and growing. I was able to delete some data using the powershell script:

foreach ($site in get-spsite -Limit ALL) { $site.Audit.DeleteEntries("05/01/2013") Write-host 'Deleting from ' $site }

The problem I have is there seems to be lots of garbage still stored in the table. Sites that have been long deleted from SharePoint are still stored in the table.

How do I delete these short of writing a delete statement in the DB itself?

3

In short, you can't in a supported method as the API requires a valid SPSite object. The supported way of getting around this is to move all sites to a new content database, then abandon the defunct content database.

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.