Troubleshoot Windows server reboot

systeminfo | grep “System Boot”

Get-EventLog System | Where-Object {$.EventID -eq “1074” -or $.EventID -eq “6008” -or $_.EventID -eq “1076”} | ft Machinename, TimeWritten, UserName, EventID, Message -AutoSize -Wrap

If your hardware uses BMC/IPMI

ipmiutil see list
001f 05/16/17 10:38:31 INF Sms  OS Critical Stop #00 OS Graceful Shutdown 6f [03 ff ff]
0020 05/16/17 10:38:31 CRT Sms  OS Critical Stop #00 Runtime Crit Stop 6f [01 0f 0f]
0021 05/16/17 10:39:53 INF Sms  OS Boot #00 C: boot completed 6f [01 ff ff]
0022 05/16/17 10:48:57 INF Sms  OS Critical Stop #00 OS Graceful Shutdown 6f [03 ff ff]
0023 05/16/17 10:48:57 CRT Sms  OS Critical Stop #00 Runtime Crit Stop 6f [01 0f 0f]
0024 05/16/17 10:50:14 INF Sms  OS Boot #00 C: boot completed 6f [01 ff ff]
Advertisements

Get a list of VMs in Hyper-V

Get a list of all VMs:

Get-VM

Get-WmiObject -Namespace root\virtualization -class msvm_computersystem | select elementname, operationalstatus, processid, name| ft -auto

Windows 2012 R2:

Get-WmiObject -Namespace root\virtualization\v2 -class msvm_computersystem | select elementname, operationalstatus, processid, name| ft -auto

Get a list of all running VMs:

Get-VM | grep Running

Get-VM |  Where-Object {$_.State –eq 'Running'}

tasklist /v | grep vmwp