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

Bash Shell: Old School Migration of ESXi Guest Virtual Machines

Step 0: Preparations Estimate file-copying duration for cut-over:- Sustained storage transfer speed using a 1GB…

PowerShell: Obtain List of Hyper-V Hosts via Active Directory

# listHyperVHostsInForests.ps1 # Version: 0.03 function listHyperVHostsInForests{ # Ensure that AD management module is available…

Quick 1-liner Generate List of Active Directory users

# Discover domain controller:echo %LOGONSERVER%# Display Users:dsquery user -limit 0 | dsget user -display -dept…