12

My computer is a Windows 11 laptop and suddenly it wakes up from suspension.

When I run the command powercfg /systempowerreport /duration 1, I can see that the cause for it is PDC Task Client: Maintenance Scheduler as of below:

enter image description here

But I got no scheduled maitenance on my computer. Anyone got a clue how to prevent that scheduler from waking up my laptop?

4 Answers4

1

I was facing the same issue, too. Let me to help you specify and solve this issue.

The problem has a brilliant solution.

First of all I recommend you to create familiar with the power management system which you can do in elevated Windows command line.

These two commands will create an HTML file which you can open in your web browser.

powercfg /sleepstudy /xml
powercfg /sleepstudy /transformxml sleepstudy-report.xml

You can create a bat file and for later analysis you can launch this bat file as administrator.

If you open the created file sleepstudy-report.html, you should be able to quickly orient yourself. At the bottom of the file is the newest power management activity. All of this is very comfortable to view and you can unfold or fold all the objects in this view for more details about particular records.

Very useful is the Start Time, Duration, State, Entry Reason, Exit Reason where you can get an overview of the power management during a particular time period.

Now to the Entry reason you mentioned: PDC Task Client: Maintenance Scheduler

This one reason of wake up your computer/laptop is the more complicated to catch, but it can be done. The answer is to look for built the value in Windows GUI settings and not in Task Scheduler.

My last wakeup from the same reason as is the subject of this thread was at a 3am clock and I can see this statement on the attached screenshot below.

Maintenance control panel view in Windows

Generated view to html power management overview

The picture is showing that all is happening here: Control Panel\System and Security\Security and Maintenance

Now. When you can change your settings, set the value to some particular time of day and you device will able to sleep in one time block.

Update 1: One question - Scheduler task - discovered. It is responsible for waking up my device at a night time despite the fact that the wake up is forbidden in the task and also in the power plan.

I used powershell to list the task. (You can use GUI to open the task for sure)

PS C:\Windows\system32> Get-ScheduledTask | where{$_.TaskPath -eq "\Microsoft\Windows\Security\PwdLess\"} | Get-ScheduledTaskInfo

LastRunTime : 18.01.2024 3:00:00 LastTaskResult : 0 NextRunTime : 19.01.2024 3:00:00 NumberOfMissedRuns : 0 TaskName : IntelligentPwdlessTask TaskPath : \Microsoft\Windows\Security\Pwdless
PSComputerName :

You can change the time to whatever you like. For this change you are supposed to have super user permissions. To get these permissions can help application named PowerRun which help you to launch Windows Task Scheduler from inside this program. You can free download this program here: https://www.sordum.org/9416/powerrun-v1-6-run-with-highest-privileges/

After you change the time, I hope now your laptop/notebook will sleep like a baby without the disturbances of the modern standby sleep state. My device did.

tripleee
  • 3,308
  • 5
  • 36
  • 35
1

Prerequisites

I assume, you already:

  • Made your S0ix sleep state "Network Disconnected" for AC and DC

    [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9]
    "ACSettingIndex"=dword:00000000
    "DCSettingIndex"=dword:00000000
    

    Source: https://www.elevenforum.com/t/enable-or-disable-network-connectivity-in-modern-standby-in-windows-11.3286/

    An alternative way:

    • Make accessible these options in Control Panel / Power Options with:

      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9]
      "Attributes"=dword:00000002
      
    • Then disable them in Control Panel / Power Options under "Networking connectivity in Standby"

  • Disabled wake timers with Control Panel / Power Options

  • Disabled wake timers with powercfg.exe (seems to be different, than the previous Control Panel version)

    # disable wake timers for all power schemes
    powercfg -list | Select-String 'GUID' |
    %{
        write-host $_
        $guid = $_ -replace '^.*:\s+(\S+?)\s+.*$', '$1'
        powercfg -setdcvalueindex $guid SUB_SLEEP RTCWAKE 0
        powercfg -setacvalueindex $guid SUB_SLEEP RTCWAKE 0
    }
    

    Source: https://superuser.com/a/1067892

PDC Task Client: Maintenance Scheduler

Only disabling Maintenance through registry worked for me. Several days passed, no more random wakeup-and-remain-active-the-whole-night issues. Fingers crossed. And I hope Microsoft won't kill this hack for a few years.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance]
"MaintenanceDisabled"=dword:00000001

Source: https://superuser.com/a/1207600

PDC Task Client: Windows Update Client

Step 1

And when you disable Maintenance, Microsoft finds a new way do annoy you. After Maintenance Scheduler disappeared from the sleepstudy, Windows Update Client started to wake up the laptop.

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate]
"AUPowerManagement"=dword:00000000

Source: https://superuser.com/a/1804998

Step 2

After exactly 1 month, Windows Update wakes up the laptop again, but it gone mad, it wakes up in each hour for a minute, absolutely doesn't care about any kind of setting.

Months of investigation, the root causes are:

  • Windows uses Task Scheduler to wake up your laptop
  • Even if you disable "Wake the computer to run this task", it has no effect, because S0ix -> S0 transition is not considered to be a "wake up", the S0ix is already a wake state
  • Even if you disable the tasks below, Windows will reenable them later, you have to "nuke" them through the file-system additionally
  • Not all tasks wake up the system, only Microsoft related tasks (eg. Windows, Office, Edge, .Net), because they use some undocumented (?) system call to change kernel power status (more details: https://www.elevenforum.com/t/enable-or-disable-network-connectivity-in-modern-standby-in-windows-11.3286/post-560966)

Solution:

  • Install SysInternals (from MS Store or from UniGetUI/WinGetUI)
  • From an administrative command prompt run psexec -i -s mmc %windir%\system32\taskschd.msc /s - it starts the TaskScheduler as SYSTEM
    • Under \Microsoft\Windows\UpdateOrchestrator disable:
      • Schedule Scan (usoclient.exe StartScan) - Yes, the "Wake the computer to run this task" is unchecked, but it still wakes up the laptop, Windows doesn't care what you configure...
      • Schedule Scan Static Task (usoclient.exe StartScan) - This is dormant for approx. 1 month after an update, then it starts to wake up the laptop in each hour during sleep until you update again.
      • Schedule Work (usoclient.exe StartWork)
      • Schedule Wake To Work (usoclient.exe StartWork)
      • Schedule Maintenance Work (usoclient.exe StartMaintenanceWork)
      • Start Oobe Expedite Work (usoclient.exe StartWork)
      • USO_UxBroker (MusNotification.exe) - This exe doesn't even exists...
    • Under \ disable:
      • MicrosoftEdgeUpdateTaskMachineCore
      • MicrosoftEdgeUpdateTaskMachineUA
    • Under \Microsoft\Office\ disable:
      • Office Apps Prewarm Recurring
      • Office Automatic Updates 2.0
      • Office Background Push Maintenance
      • Office ClickToRun Service Monitor
      • Office Feature Updates
      • Office Feature Updates Logon
    • Under \Microsoft\Windows.NET Framework\ disable:
      • .NET Framework NGEN v4.0.30319 Critical
      • .NET Framework NGEN v4.0.30319 64 Critical
    • Under \Microsoft\Windows\InstallService\ disable:
      • WakeUpAndScanForUpdates
      • WakeUpAndContinueUpdates
      • ScanForUpdates
    • Under \Microsoft\Windows\SharedPC\ disable:
      • Account Cleanup
    • Under \Microsoft\Windows\SoftwareProtectionPlatform\ disable:
      • SvcRestartTaskLogon
      • SvcRestartTaskNetwork
    • Yeah, I'm sure not all of these are strictly necessary to disable
  • As written here: https://superuser.com/a/973029
    • Modify file system permissions for the tasks mentioned above in these folders as described in the second half of Step 2:
      • C:\Windows\System32\Tasks\Microsoft\Windows\UpdateOrchestrator
      • C:\Windows\System32\Tasks
      • C:\Windows\System32\Tasks\Microsoft\Office
      • C:\Windows\System32\Tasks\Microsoft\Windows.NET Framework
    • Execute Step 3 and 4
      • Note on Step 4: not all of your network adapters have a "Power Management" tab, so for each of your LAN and WiFi adapters go to their "Advanced" tab, and disable:
        • Wake on Magic Packet
        • Wake on pattern match
  • Just to be sure, check with powercfg /waketimers that there are no more waketimers left

Result:

  • On AC (when plugged into the wall) Windows doesn't care, will never ever sleep properly, never ever go into Network Disconnected sleep, but at least won't wake up in each hour completely, and the CPU will be in low power state ~50% of the time
  • On DC (battery), it will do the same for ~30 minutes, then log an event "Restricted Standby Battery Drain Budget Exceeded" and go to real network disconnected S0ix sleep, where only 10% of the battery is used per day, because the CPU will be ~99% of the time in low power state

Still problem:

  • After 4-5 weeks, immediately after you put your laptop into sleep, it wakes up for 5-10 seconds, then sleeps again for a few hours
  • Tested with get-scheduledtask | get-scheduledtaskinfo | where-object{$_.lastruntime -gt (get-date).addminutes(-1)} the "StartOobeAppsScanAfterUpdate" task wakes up the machine, so next time it happens, this task will also be disabled and nuked in the filesystem

Would be nice:

  • Do not wait 30 minutes in DC, go directly into net. disconnected S0ix sleep
  • Do the same in AC

Rant: Why disable these? Because Microsoft doesn't care what you configure:

  • Even when my Sleep State is Network Disconnected, Windows doesn't care, it is still fully connected, wakes up, and sometimes crashes the whole system.
  • Even when these maintenance/update tasks scheduled for the night, Windows doesn't care, wakes up my laptop 4pm in it's bag, overheats it, drains battery completely, then crash.
lmagyar
  • 191
0

I am experiencing this same issue, the solutions may be different for each device due to drivers, devices and other components. You can run a trace against the PDC Task Client (Power Dependency Coordinator) via the following MS Documentation. This will hopefully provide you the details you need to discover the process causing the wake-from-sleep.

To evaluate connected standby resume performance, take a trace with the provider named Microsoft-Windows-PDC, which is the system-supplied power dependency coordinator. The Trace_start.cmd file that is included with the WPA package includes this and other providers that are required to measure resume performance. The WPA package is available in the Windows Assessment and Deployment Kit (Windows ADK) download and includes scripts and documentation for modern standby analysis.

(From the above article)To collect a trace

  • Open a Command Prompt window as Administrator.
  • Run the Install.cmd command to install the package.
  • Follow the instructions in Capture a WPA trace to collect the trace.
  • For validating resume performance, a 5-10 minute session should be sufficient.
  • To save the trace file, rename it or save it to a different location because a file with this name will be overwritten the next time a trace is taken.
  • Repeat steps 3-4 to gather another trace.
0

The command to check last wake up is:

powercfg /lastwake

Then there is chance that you can turn that wake up off by:

Control Panel-Power options-change current plan options-Change advanced-Sleep-Resume by scheduler-turn off.

Also in this window you have other options when to wake up computer, so change accordingly.

pbies
  • 3,550