How can I delete old Windows event logs

Jimmy Afflick 80 Reputation points
2024-07-29T12:44:04.46+00:00

Hi Experts,

Windows server run out of space on C drive due to GPO that doesn't delete old event logs.
Could someone please let me know how to delete old event logs via GPO

I am looking forward to hearing from you

Regards
Leo

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,671 questions
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,259 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dominique Schluep 325 Reputation points
    2024-07-30T11:50:06.1266667+00:00

    Hello Jimmy Afflick

    You could do that with PowerShell:

    #Clear Specific Log
    Clear-EventLog -LogName LogName
    
    #Clean All Logs
    Get-EventLog -LogName * | ForEach {Clear-EventLog $_.Log}
    

    Deleting old Windows event logs can be beneficial in certain situations, but it also has potential downsides, such as the loss of historical data, issues with security audits, and hindering troubleshooting efforts.

    Kind regards
    Dom

    0 comments No comments