Removing old iis logs in plesk
Here is the situation
I have 1600 + clients per server
And every client has its own IIS logs in their folder
For example
IIS log directory for Client1
“E:\Vhosts\Client1\Statistics\logs”
Wrote a Simple Script where it goes into these folders and removes the log files of every client which are 15 days old
$allclients = Get-ChildItem "E:\vhosts" Foreach ($client in $allclients) { $location = "E:\vhosts\$client\statistics\logs\w3*" $DeleteDays = (Get-Date).adddays(-4) Get-ChildItem "$location" -Recurse | Where-object {$_.lastwritetime -lt $DeleteDays} | remove-item }
Save it to .ps1 and run it
Customize it as per your requirement
For plesk servers these are much suitable