Avatar of Someone
Someone

asked onΒ 

How to prevent windows servers from restarting after deploying updates using powershell script

Hello IT people

I've scheduled a script to run everyday at night for the servers to check for update and install it if the servers found one.
But recently, the servers keeps restarting everytime after installing updates. Is there any way I could stop them from restarting?

my script:


Set-ExecutionPolicy RemoteSigned -Confirm:$false
Import-Module PSWindowsUpdate
Get-WindowsUpdate
Install-WindowsUpdate -Confirm:$false
Set-ExecutionPolicy Restricted -Confirm:$false

Open in new window

PowershellWindows Server 2016InstallationWindows OSWSUS

Avatar of undefined
Last Comment
Someone
Avatar of arnold
arnold
Flag of United States of America image

Check install-windowsupdate option to see whether -AutoReboot is set by default and locate the option the disables it.
An update might require a reboot to complete.


See whether get-windowsupdate if you can filter updates on whether a reboot is required.
Avatar of Someone
Someone

ASKER

But how to disable the -autoreboot option?

Because it's already not in the script
ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Someone
Someone

ASKER

-IgnoreReboot πŸ‘πŸΎ
Thank you for helping me think πŸ˜…
Windows OS
Windows OS

This topic area includes legacy versions of Windows prior to Windows 2000: Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions including Windows Mobile.

129K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo