How to Prevent Windows 10 Updates and Manage Remote Sessions Without Rebooting

Introduction
In many enterprise environments, automatic Windows 10 updates can disrupt critical applications. This guide provides step-by-step instructions on preventing updates, forcefully logging off users without rebooting, and managing remote machines efficiently using PowerShell, Command Prompt, and PsExec.


Step 1: Prevent Windows 10 from Installing Updates

Option 1: Disable Windows Update Service (Quick & Easy)

  1. Open Run (Win + R), type services.msc, and press Enter.
  2. Locate Windows Update in the list.
  3. Right-click and select Properties.
  4. Set Startup type to Disabled.
  5. Click Stop, then Apply and OK.

๐Ÿ’ก This prevents Windows from automatically downloading and installing updates.

Option 2: Use Group Policy to Block Updates

  1. Open Run (Win + R), type gpedit.msc, and press Enter.
  2. Navigate to:Computer Configuration โ†’ Administrative Templates โ†’ Windows Components โ†’ Windows Update
  3. Double-click Configure Automatic Updates.
  4. Select Disabled, then click Apply and OK.

Option 3: Delete Pending Updates Using PowerShell

If Windows updates are already downloaded and pending installation:

Stop-Service wuauserv -Force
Stop-Service bits -Force
Remove-Item -Path "C:\Windows\SoftwareDistribution\Download\*" -Recurse -Force
Start-Service wuauserv
Start-Service bits

๐Ÿ’ก This clears pending updates, preventing them from being installed.


Step 2: Completely Cancel Pending Updates and Remove Notification

Option 1: Clear the Update Queue from Windows Update

If stopping services alone doesn’t remove pending updates, run this in PowerShell:

Remove-Item -Path "C:\Windows\WinSxS\pending.xml" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "C:\Windows\SoftwareDistribution\*" -Recurse -Force

๐Ÿ’ก This removes Windows’ record of pending updates.

Option 2: Flush Update Status from Windows Registry

If the notification persists, remove any registry traces of pending updates:

Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" -Name "RebootRequired" -ErrorAction SilentlyContinue
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Services\Pending" -ErrorAction SilentlyContinue

๐Ÿ’ก This tells Windows that no updates are waiting for a reboot.

Option 3: Reset Windows Update Components

Run the following commands in CMD (Admin):

net stop wuauserv
net stop cryptsvc
net stop bits
net stop msiserver
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 Catroot2.old
net start wuauserv
net start cryptsvc
net start bits
net start msiserver

๐Ÿ’ก This resets Windows Update components so the system forgets pending updates.

Force Windows to Acknowledge No Updates Are Pending

Run:

wuauclt.exe /resetauthorization /detectnow

or

gpupdate /force

๐Ÿ’ก This forces Windows to recheck update policies and clear any pending update flags.

Reboot Without Installing Updates

To make sure Windows doesn’t install the update after a reboot, run:

shutdown /r /t 0

๐Ÿ’ก This reboots without triggering pending updates.


Step 3: Remotely Log Off a User Without Rebooting

Option 1: Using PowerShell (Requires Admin Privileges)

  1. Open PowerShell as Administrator.
  2. Run:query user /server:RemotePCName
  3. Identify the Session ID of the user you want to log off.
  4. Log them off with:logoff <SessionID> /server:RemotePCName

๐Ÿ’ก This logs off the user without shutting down the VM.

Option 2: Using PsExec (If PowerShell Remoting is Blocked)

  1. Download PsExec.
  2. Extract it to C:\PSEXEC.
  3. Open Command Prompt as Administrator.
  4. Navigate to the PsExec folder:cd C:\PSEXEC
  5. Check who is logged in:psexec \RemotePCName -u Administrator -p YourPassword query session
  6. Log off the user:psexec \RemotePCName -u Administrator -p YourPassword logoff <SessionID>

๐Ÿ’ก This method works even if WinRM and RPC are blocked.

Option 3: Using Command Prompt (WMI-Based Logoff)

If PsExec fails, try using WMI:

wmic /node:RemotePCName /user:Administrator /password:YourPassword computersystem where name="RemotePCName" call Win32Shutdown 4

๐Ÿ’ก This forces all logged-in users to log off without rebooting! ๐Ÿš€


Step 4: Ensure Remote Management Works for Future Use

Once you regain access, run this on the remote VM to prevent future lockouts:

Enable-PSRemoting -Force
Set-Service -Name RemoteRegistry -StartupType Automatic
New-NetFirewallRule -DisplayName "Allow RDP and RPC" -Direction Inbound -Protocol TCP -LocalPort 135,3389 -Action Allow

๐Ÿ’ก This allows future remote PowerShell and PsExec commands to execute successfully.


Conclusion

By following this guide, you can prevent Windows 10 from automatically updating, remotely log off users without rebooting, and ensure seamless remote access to your systems. This is critical for IT environments where stability is a priority.

Let me know if you need additional troubleshooting steps!

ยฉ 2012โ€“2025 Jet Mariano. All rights reserved.
For usage terms, please see the Legal Disclaimer.

error: Content is protected !!