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

PowerShell: Split Array into Multiple Sub-Arrays and Inflate Strings to Certain Lengths to Create Visual Columns

What does a nerd do on his free time? Give himself little puzzles to solve.…

Basic HTML and HTML5: Add a Submit Button to a Form

<h2>CatPhotoApp</h2><main><p>Click here to view more <a href="#">cat photos</a>.</p><a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying…

PowerShell: How To Bypass Double Hop Problems

# This is a working example of hoping without delegation. Fresh creds can be passed…