Clear All Event Logs in Event Viewer in Windows  

Page 7 of 11 FirstFirst ... 56789 ... LastLast

  1. Posts : 2,450
    Windows 10 Pro x64
       #60

    When you test and then provide an answer... make sure you give the correct one (the one that works!!!)

    Code:
    $EventLogs = Get-WinEvent -ListLog * 
    foreach($log in $EventLogs) { [System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog($log.LogName) }
    This should work.
      My Computer


  2. Posts : 68,954
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #61

    Sorry for the late reply Dimitri @ddelo,

    This is what I got below with those commands in an elevated PowerShell. It looks like the "System" logs don't get cleared in Event Viewer.

    Clear All Event Logs in Event Viewer in Windows-ps.png

    Clear All Event Logs in Event Viewer in Windows-ev.jpg
      My Computers


  3. Posts : 2,450
    Windows 10 Pro x64
       #62

    Brink said:
    Sorry for the late reply Dimitri @ddelo,

    This is what I got below with those commands in an elevated PowerShell. It looks like the "System" logs don't get cleared in Event Viewer.

    Now I have to apologize for the delayed answer. You see my daughter was visiting and I had other priorities....

    OK, this thing is starting to get into my nerves!

    While looking to see why the System log was skipped, I tried to make it more efficient, by adding a "where" clause... and guess what... problem resolved (pending your confirmation). So now this should be the command:

    Code:
    Get-WinEvent -ListLog * | where {$_.RecordCount} | ForEach-Object -Process { [System.Diagnostics.Eventing.Reader.EventLogSession]::GlobalSession.ClearLog($_.LogName) }
    Regarding the red error you're getting, which I also get, is attributable to the "Microsoft-Windows-LiveId/Operational" log which needs special treatment to be cleared.

    Hope to have finally nailed it. Awaiting your comment!
    Take care mate
      My Computer


  4. Posts : 68,954
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #63

    Works great now. I'll add it to Option 3 now.
      My Computers


  5. Posts : 2,450
    Windows 10 Pro x64
       #64

    Brink said:
    Works great now. I'll add it to Option 3 now.

      My Computer


  6. Posts : 204
    Windows 10 Pro
       #65

    Question; I've been using the .BAT file (Win 7 Viewer.bat) for a few yrs and when running it as Admin it always sped thru the cleaning mode, but now, it has slowed down to where it does one line at a time and takes a long time to complete.

    Could this be a Win10 update thing? Or a setting somewhere that has caused this to slow down? In Safe Mode it runs as expected, which is very quick an only takes less than a minute to complete whereas now not in Safe Mode it takes up to 3 or 4 minutes to complete. I'm thinking it may be a permission thing which it did not need in the past.
      My Computer


  7. Posts : 68,954
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #66

    tazmo8448 said:
    Question; I've been using the .BAT file (Win 7 Viewer.bat) for a few yrs and when running it as Admin it always sped thru the cleaning mode, but now, it has slowed down to where it does one line at a time and takes a long time to complete.

    Could this be a Win10 update thing? Or a setting somewhere that has caused this to slow down? In Safe Mode it runs as expected, which is very quick an only takes less than a minute to complete whereas now not in Safe Mode it takes up to 3 or 4 minutes to complete. I'm thinking it may be a permission thing which it did not need in the past.

    Hello mate,

    How does the .bat file from Option 1 here instead work for you?
      My Computers


  8. Posts : 204
    Windows 10 Pro
       #67

    Hey Brink,,

    Option 1 now seems to work a tad faster than the older model. I'd say it cuts the time in half but is not as quick as it once was. But hey it's faster and thanks I'll be using this one from now on....
      My Computer


  9. Posts : 68,954
    64-bit Windows 11 Pro for Workstations
    Thread Starter
       #68

    tazmo8448 said:
    Hey Brink,,

    Option 1 now seems to work a tad faster than the older model. I'd say it cuts the time in half but is not as quick as it once was. But hey it's faster and thanks I'll be using this one from now on....
      My Computers


  10. Posts : 237
    windows 10 Build 20215
       #69

    I had the same slowdown. I turned off Malwarebytes and regained all the speed I originally had.
      My Computers


 

Tutorial Categories

Clear All Event Logs in Event Viewer in Windows Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 07:32.
Find Us




Windows 10 Forums