Problem Statement: Need to clear off Application, Security and System Event logs of your Windows PC? Well here's the solution. [sourcecode language="powershell"] foreach($computer in $args) { $ALive=get-wmiobject win32_pingstatus -Filter "Address='$computer'" | Select-Object statuscode if($ALive.statuscode -eq 0) { $logs = [System.Diagnostics.Eventlog]::GetEventLogs("$computer") $Applogs = $logs|where-object {$_.logdisplayname -eq "Application"} $Applogs.clear() $Securitylogs = $logs|where-object {$_.logdisplayname -eq "Security"} $Securitylogs.Clear() $Systemlogs … Continue reading PowerShell: Clear Event logs from Windows machine