There isn't an option to limit by time stamp. You can limit the log by file size.
--please don't forget to Accept as answer if the reply is helpful--
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dear Expert,
Good Day
May i know how to limit the windows log in event viewer to something like 1 or 2 weeks? Meaning that after 1-2 weeks it will overwrite the old log in order to reduce the log size that keep growing and save some space.
Thanks
H
There isn't an option to limit by time stamp. You can limit the log by file size.
--please don't forget to Accept as answer if the reply is helpful--
Hi,
You can take a look at these docs about Limit-EventLog cmd:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/limit-eventlog?view=powershell-5.1
https://4sysops.com/archives/managing-event-logs-with-powershell-part-1
The Limit-EventLog cmdlet sets the maximum size of a classic event log, how long each event must be retained, and what happens when the log reaches its maximum size. You can use it to limit the event logs on local or remote computers.
OverflowAction specifies what happens when the event log reaches its maximum size. The acceptable values for this parameter are:
If you want to save some space, you can also use the following methods to adjust event log size:
https://helpcenter.netwrix.com/NA/Configure_IT_Infrastructure/Windows_Server/WS_Event_Log_Settings.html
Thanks for your time!
Best Regards,
Mico Mi
-----------------------------
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.