Get Sleep History

11/15/2016

Name:

Get Sleep History

Category:

Event Logs

Description: 

Gets history showing when the target computer went to sleep.

Required Software:

PowerShell

Command:

Write-Output "Get sleep history for $(Computer:TARGET)"

Get-WinEvent -ComputerName $(Computer:TARGET) -LogName system -MaxEvents 3000 -ErrorAction SilentlyContinue |
Where {$_.ProviderName -match "Microsoft-Windows-Power-Troubleshooter"} |
Format-List -property TimeCreated, LogName, ProviderName, LevelDisplayName, ID, Message

More Info/Usage:

Get-WinEvent