Thursday 28 January 2016



How to Clear dbo.auditdata table from your SharePoint Content database table
Do NOT do this on a production server directly. Try to run in Development environment.
Logging 3-26-2013 2-49-14 PM
Change retention days 3  from 14 by using following PowerShell command:
Get-SPUsageDefinition  | ForEach-Object { Set-SPUsageDefinition $_ –DaysRetained 3}
The next time the Usage Log File timer jobs run it’ll clean out everything more than 3 days old. If we want to manually trigger those jobs we can use this PowerShell:
Get-SPTimerJob | Where-Object { $_.title -like "*usage data*" } | Start-SPTimerJob

It will take some time to clear the Audit data table.

Another way:

Below is the script to delete records for particular site:

Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$site = Get-SPSite -Identity "Your Site"

$date = Get-Date

$date = $date.AddDays(-3)

#Delete Audit logs

$site.Audit.DeleteEntries($date)



No comments:

Post a Comment