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

Resolve Windows 2003 Logon Screen Blackout Problems

The problem:Administrators are unable to logon to a Windows 2003 Server. This is what they…

Virtual Machine Manager (VMM) Error ID: 1730

Symptom: $vmName='bad-guestvm' $vm = Get-SCVirtualMachine -Name $vmName Read-SCVirtualMachine -VM $vm Read-SCVirtualMachine : The selected action…

PowerShell: WinSCP Module

$username='bongo' $port=20202 $remoteHost='dev-sftp.kimconnect.net' $privateKey='C:\scripts\keys\testkey.ppk' $remoteRoot='/' $downloadFolder='D:\downloads' $remoteDirectory='/var/www/sftp.kimconnect.net' $currentDirectory=$remoteDirectory $localFolder=(New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path $appName='winscp' function includePowerShellWrapper($appName){ #…