Results 1 to 6 of 6

Thread: Sleep log

  1. #1
    5 Star Lounger
    Join Date
    Jul 2003
    Location
    USA
    Posts
    728
    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
    728
    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,414
    Thanks
    33
    Thanked 195 Times in 175 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 04:10.
    BATcher

    Time prevents everything happening all at once...

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

    RetiredGeek (2016-08-06)

  5. #4
    5 Star Lounger
    Join Date
    Dec 2009
    Location
    Delaware, US
    Posts
    1,160
    Thanks
    19
    Thanked 99 Times in 88 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,434
    Thanks
    372
    Thanked 1,457 Times in 1,326 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,414
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Good stuff, RG - much more intelligible results!
    BATcher

    Time prevents everything happening all at once...

Posting Permissions

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