Results 1 to 6 of 6

Thread: Sleep log

  1. #1
    5 Star Lounger
    Join Date
    Jul 2003
    Location
    USA
    Posts
    732
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Sleep log

    Is there a log kept of when PC is put to sleep? Can't find anything in Event Viewer.

    Thank you

  2. #2
    5 Star Lounger
    Join Date
    Jul 2003
    Location
    USA
    Posts
    732
    Thanks
    7
    Thanked 2 Times in 2 Posts

  3. #3
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,496
    Thanks
    34
    Thanked 203 Times in 182 Posts
    A fairly similar question is to determine How to Check if Last Boot was from Fast Startup, Full Shutdown, or Hibernate by the inimitable Brink, and including some rather obscure PowerShell. No mention of 'Sleep', though...

    I would guess that the PowerShell script is interrogating the System Event Log?

    I wonder whether this function can also be done using WMIC? Any experts?
    Last edited by BATcher; 2016-08-06 at 03:10.
    BATcher

    "The trouble with quotes on the internet is that you can never know if they are genuine."
    Abraham Lincoln
    

  4. The Following User Says Thank You to BATcher For This Useful Post:

    RetiredGeek (2016-08-06)

  5. #4
    Bronze Lounger
    Join Date
    Dec 2009
    Location
    Delaware, US
    Posts
    1,222
    Thanks
    20
    Thanked 101 Times in 90 Posts
    Quote Originally Posted by acerfmayer View Post
    Is there a log kept of when PC is put to sleep?
    Curious why you ask...

    For the past couple months, I've had problems with my Win7 computer not wanting to go to sleep. To make matters worse, if I manually put it to sleep it would often hang part way through the process and have to be rebooted to restart.

    It's not a really huge issue right now compared to other more pressing things, but it's been my plan to start to dig into what's changed to cause this. Likely something has gotten updated and it's remaining active in a way that is keeping the computer from going into "idle mode".
    Graham Smith
    DataSmith, Delaware
    "For every expert there is an equal and opposite expert.", Arthur C. Clarke (1917 - 2008)

  6. #5
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,777
    Thanks
    403
    Thanked 1,551 Times in 1,405 Posts
    BATcher,

    Here's a slightly more user friendly version of Brink's code:
    Code:
    $BootType = @("Cold boot from full shutdown",
                  "hybrid boot (fast startup)",
                  "Resume from hibernation")
    
    Clear-Host
    
    Get-WinEvent -ProviderName Microsoft-Windows-Kernel-boot -MaxEvents 10 | 
         Where-Object {$_.id -like “27”} |
         ForEach-Object { 
          "$($BootType[$_.Message.Substring(20,1)]) at $($_.TimeCreated)" 
         }
    Sample run after a couple reboots with different power settings and increasing the -MaxEvents to 20 to capture them all:
    Code:
    hybrid boot (fast startup) at 08/06/2016 12:20:21
    Resume from hibernation at 08/06/2016 12:12:19
    Cold boot from full shutdown at 08/06/2016 12:06:43
    HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  7. #6
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,496
    Thanks
    34
    Thanked 203 Times in 182 Posts
    Good stuff, RG - much more intelligible results!
    BATcher

    "The trouble with quotes on the internet is that you can never know if they are genuine."
    Abraham Lincoln
    

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •