Quantcast
Channel: TechNet Technology News
Viewing all articles
Browse latest Browse all 13502

Reading Hyper-V Event logs with PowerShell

$
0
0

Here is a handy tip – it is quite easy to gather any information that Hyper-V puts in the event log from PowerShell.

You can get all Hyper-V related events by running:

Get-WinEvent -FilterHashTable @{LogName ="Microsoft-Windows-Hyper-V*"}

But I would not recommend that, as you will get a lot of events!  What is more useful is just displaying any error messages that were logged in the last 24 hours – with a command like this:

Get-WinEvent -FilterHashTable @{LogName ="Microsoft-Windows-Hyper-V*"; StartTime = (Get-Date).AddDays(-1); Level = 2}

Alternatively – you can look at the warnings with this command:

Get-WinEvent -FilterHashTable @{LogName ="Microsoft-Windows-Hyper-V*"; StartTime = (Get-Date).AddDays(-1); Level = 3}

Which gives an output like this:

image

Cheers,
Ben


Viewing all articles
Browse latest Browse all 13502

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>