Categories

CTP3 – Clear-EventLog

Continuing our tour around the event log cmdlets we come to Clear-EventLog.  This does exactly what it says – it clears the entries out of one or more logs. Note that it does not backup the entries in anyway – it is just a clear.

We can clear a single log

Clear-EventLog -LogName "Windows PowerShell"

or we can work with multiple logs – for instance based on the number of records

Get-EventLog -List | Where{$_.Entries.Count -gt 5000} | Foreach {Clear-EventLog -LogName $_.Log}

We need administrator access on Vista and later. The usual –whatif and –confirm parameters are available.  This cmdlet also has a –computername parameter for working with remote machines

 

Technorati Tags: ,,

Leave a Reply