Skip to content

Instantly share code, notes, and snippets.

@AnthonyMastrean
Last active August 10, 2017 23:16
Show Gist options
  • Save AnthonyMastrean/7422369 to your computer and use it in GitHub Desktop.
Save AnthonyMastrean/7422369 to your computer and use it in GitHub Desktop.
Prevent Windows update from forcibly rebooting the computer
$key = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU"
if(-not(Test-Path $key)) {
New-Item $key -Force
}
New-ItemProperty -Path $key -Name "NoAutoRebootWithLoggedOnUsers" -PropertyType DWORD -Value 1
@AnthonyMastrean
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment