Posted On February 8, 2022

How To Prevent Windows From Automatically Rebooting After Updates

kimconnect 0 comments
blog.KimConnect.com >> Codes >> How To Prevent Windows From Automatically Rebooting After Updates
# Add New Registry Key
$regHive='REGISTRY::HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
$keyname='NoAutoRebootWithLoggedOnUsers'
$value=1
Set-ItemProperty -Path $regHive -Name $keyname -value $value

# Validation
Get-ItemProperty $regHive -name $keyname

PS C:\WINDOWS\system32> Get-ItemProperty $regHive -name $keyname


NoAutoRebootWithLoggedOnUsers : 1
PSPath                        : Microsoft.PowerShell.Core\Registry::HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpd
                                ate\AU
PSParentPath                  : Microsoft.PowerShell.Core\Registry::HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpd
                                ate
PSChildName                   : AU
PSProvider                    : Microsoft.PowerShell.Core\Registry

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Installing DotNet 3.5 on Windows with Restricted Internet Access

# Set Windows Source files # Assuming that a Windows ISO / DVD Rom have…

PowerShell: Change Google Chrome Cache Directory

Lately, I've been running a buck load of chrome tabs that utilize all available I/O…

PowerShell: Execute as System Elevated Session with a Domain Administrator account

Part 1: Relaunch script in the context of Elevated System privileges: ############# Ensure that Program…