WMI and Computer Settings - Date / Time of Last Wakeup

I am trying to find out when was the last time the computer woke up from standby / hibernation. I know I can get this by looking at Win32_PowerManagementEvent, but that doesn't work in this case as I need something I can poll - any ideas? It doesn't have to be WMI, I'm just guessing it would be.

Thank!

0


source to share


1 answer


Actually, as is usually the case, I figured it out as soon as I posted it.

So, to see when the computer wakes up, which is EventType 7 in Win32_PowerManagementEvent, I used Powershell.



Register-WmiEvent -query "Select * From Win32_PowerManagementEvent where EventType=7" -messagedata "Power Management Resume" -sourceidentifier "Resume"

      

Then I went in and back from standby and did Get-PSEvent which showed my event that I created. I could just use -action to assign the scriptblock to fire when this event occurs, but I was looking for something to poll.

+2


source







All Articles