Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Looking at Logs with PowerShell

$
0
0

Summary: Find logs that are not enabled with Windows PowerShell.

Hey, Scripting Guy! Question How can I use Windows PowerShell to quickly see which logs in the event log tool are not enabled by default?

Hey, Scripting Guy! Answer Use the Get-WinEvent cmdlet to produce a list of all the logs, then pipe the results to the Where-Object cmdlet,
           and specify that you want those that are not enabled, for example:

Get-WinEvent -ListLog * -ea 0 | where {-not ($_.isenabled)}

Note   Many logs require elevated permissions for access. Either launch Windows PowerShell with elevated rights,
or specify an error action of 0 to block error messages related to not having access.


Viewing all articles
Browse latest Browse all 3333

Trending Articles