Book Image

Microsoft Hyper-V PowerShell Automation

By : Vinith Menon
Book Image

Microsoft Hyper-V PowerShell Automation

By: Vinith Menon

Overview of this book

Table of Contents (13 chapters)
Microsoft Hyper-V PowerShell Automation
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Troubleshooting the Hyper-V environment using the event log


The Hyper-V administrator can use the Get-EventLog cmdlet to get the events related to Hyper-V. Monitoring these events using the Event Viewer GUI is a very tedious task. The following screenshot shows a view of the event log in the Event Viewer GUI. Scrolling through these events is a tedious task, as there are a lot of system-related events that are not related to Hyper-V:

The Get-EventLog cmdlet can be directed to filter only the events that are related to Hyper-V. To do this, open up a PowerShell prompt in administrative mode and run the following command:

Get-EventLog system -source *Hyper-V* -after "07/21/2014"

The preceding command will query for all events related to Hyper-V in the system event log that occurred after July 27, 2014. Once we execute the preceding command, we will get the output returned as follows:

As you can see, I get all the required information filtered out from thousands of events that were registered...