Do NOT do this on a production server directly. Try to run in Development environment.
Run Powershell : Run the command Get-SPUsageDefinition
It will shows all the things that are retained, and for how long.
Change retention days 3 from 14 by using following PowerShell command:
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:
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