PowerShell Limit-EventLog Cmdlet

PowerShell Limit-EventLog Cmdlet

PowerShell Limit-EventLog Cmdlet

Hello Everyone

Welcome to CloudAffaire and this is Debjeet.

In the last blog post, we have discussed Write-EventLog cmdlet in PowerShell.


In this blog post, we will discuss Limit-EventLog cmdlet in PowerShell. You can use Limit-EventLog cmdlet to modify an event log property. Using Limit-EventLog cmdlet, you can set the event log’s properties like retention period, maximum size and action performed when the log reaches its maximum size. You need to have administrator access to order to change an event log property. You can use Limit-EventLog cmdlet to change the event log property of a local or remote computer.

Limit-EventLog Cmdlet Syntax:

Limit-EventLog Cmdlet Argument List:

  • ComputerName: Specifies remote computers. The default is the local computer.
  • Confirm: Prompts you for confirmation before running the cmdlet.
  • LogName: Specifies the event logs. Enter the log name (the value of the Log property; not the LogDisplayName) of one or more event logs, separated by commas.
  • MaximumSize: Specifies the maximum size of the event logs in bytes. Enter a value between 64 kilobytes (KB) and 4 gigabytes (GB). The value must be divisible by 64 KB (65536).
  • OverflowAction: Specifies what happens when the event log reaches its maximum size. The acceptable values for this parameter are:
    • DoNotOverwrite: Existing entries are retained and new entries are discarded.
    • OverwriteAsNeeded: Each new entry overwrites the oldest entry.
    • OverwriteOlder: New events overwrite events older than the value specified by the MinimumRetentionDays property.
  • RetentionDays: Specifies the minimum number of days that an event must remain in the event log.
  • WhatIf: Shows what would happen if the cmdlet runs. The cmdlet is not run.

PowerShell Limit-EventLog Cmdlet:

Hope you have enjoyed this article. In the next blog post, we will discuss Clear-EventLog CmdLet in PowerShell.

To Set more details on PowerShell, kindly follow below official documentation



Leave a Reply

Close Menu