Friday, January 13, 2017

Remove IIS Logs Script

Script to remove IIS logs:


$start = (get-date).AddDays(-30) 
Get-ChildItem -Path c:\inetpub\logs\logfiles\w3svc*\*.log | where {$PSItem.LastWriteTime -lt $start} | Remove-Item

Add this sctipt to windows scheduler, and logs will be remove automatically!

No comments: