Clear-EventLog

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

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

Key:
   -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.

   -confirm
       Prompt for confirmation before executing the command.

   -whatIf
       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.

Examples

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 SS64.com
Some rights reserved