Delete all entries from a specified event log on a local or remote computer.

      Clear-EventLog [-LogName] string[] [[-ComputerName] string[]]
         [-Confirm] [-WhatIf]  [CommonParameters]

   -logName string
        Name of the log file from which to clear log events.

   -ComputerName string[]
        Clear events from a remote computer.
        The default is the local computer.

       Prompt for confirmation before executing the command.

       Describe the command without actually executing it.

The ComputerName may be a NetBIOS name, an Internet Protocol (IP) address, or a fully qualified domain name. To specify the local computer, type the computer name, a dot (.), or "localhost". -ComputerName does not rely on Windows PowerShell remoting.


Clear the Application, System and PowerShell event logs:

PS C:\> Clear-eventlog -log application, system, "Windows PowerShell"

“Beware the barrenness of a busy life” ~ Socrates

Related PowerShell Cmdlets

Get-Eventlog - Get event log data

Copyright © 1999-2024
Some rights reserved