Skip to content
This repository was archived by the owner on May 28, 2021. It is now read-only.

Commit 3155383

Browse files
committed
Add "Disable nightly wake-up for Automatic Maintenance", closes #240
1 parent f4c9bba commit 3155383

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

Default.preset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ SetDEPOptOut # SetDEPOptIn
6767
# DisableUpdateMSRT # EnableUpdateMSRT
6868
# DisableUpdateDriver # EnableUpdateDriver
6969
# DisableUpdateAutoDownload # EnableUpdateAutoDownload
70-
DisableUpdateRestart # EnableUpdateRestart
70+
DisableMaintenanceWakeUp # EnableMaintenanceWakeUp
7171
# DisableHomeGroups # EnableHomeGroups
7272
DisableSharedExperiences # EnableSharedExperiences
7373
# EnableClipboardHistory # DisableClipboardHistory

Win10.psm1

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,22 +1035,21 @@ Function EnableUpdateAutoDownload {
10351035
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUOptions" -ErrorAction SilentlyContinue
10361036
}
10371037

1038-
# Disable Windows Update automatic restart
1039-
# Note: This doesn't disable the need for the restart but rather tries to ensure that the restart doesn't happen in the least expected moment. Allow the machine to restart as soon as possible anyway.
1040-
Function DisableUpdateRestart {
1041-
Write-Output "Disabling Windows Update automatic restart..."
1038+
# Disable nightly wake-up for Automatic Maintenance and Windows Updates
1039+
Function DisableMaintenanceWakeUp {
1040+
Write-Output "Disabling nightly wake-up for Automatic Maintenance..."
10421041
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU")) {
10431042
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Force | Out-Null
10441043
}
1045-
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -Type DWord -Value 1
10461044
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -Type DWord -Value 0
1045+
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" -Name "WakeUp" -Type DWord -Value 0
10471046
}
10481047

1049-
# Enable Windows Update automatic restart
1050-
Function EnableUpdateRestart {
1051-
Write-Output "Enabling Windows Update automatic restart..."
1052-
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoRebootWithLoggedOnUsers" -ErrorAction SilentlyContinue
1048+
# Enable nightly wake-up for Automatic Maintenance and Windows Updates
1049+
Function EnableMaintenanceWakeUp {
1050+
Write-Output "Enabling nightly wake-up for Automatic Maintenance..."
10531051
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "AUPowerManagement" -ErrorAction SilentlyContinue
1052+
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" -Name "WakeUp" -ErrorAction SilentlyContinue
10541053
}
10551054

10561055
# Stop and disable Home Groups services - Not applicable since 1803. Not applicable to Server

0 commit comments

Comments
 (0)