Check for restart status after WSUS auto update

Source: Internet
Author: User

Beans new with a WSUS server, working properly, but the more annoying is sometimes patch update more, the default one reboot not, but also have to reboot several times to complete all the installation. If you do not restart the installation in a timely manner, Windows 2012 will automatically restart after a day, and if it happens to be a working day, it will be dumbfounded.


How to solve it? The beans are going to write a script to automatically detect the restart status, and if necessary, send a restart command.


The script that detects the restart status is already available on the web and has been tried very well.

https://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542


Once you have downloaded this script, you can implement my requirements with a little modification.


Simple test, create an array, put in my server name, dot source download script, inside the local variable becomes a global variable, so you can directly invoke the function of the script.

Then compare the status to restart the corresponding server.


[Email protected] ("Sydwsus", "melfs01", "sydit01"). C:\temp\get-pendingreboot.ps1$results=get-pendingreboot-computername $namesforeach ($c in $results) {if ($c. Rebootpending-eq "True") {restart-computer $c. Computer}}


In addition, if a server is found to be in a countdown restart state, but the condition does not allow you to restart, you can forcibly terminate the countdown by shutting down Windows Update processes and services.

This article is from the "Mapo Tofu" blog, please be sure to keep this source http://beanxyz.blog.51cto.com/5570417/1664082

Check for restart status after WSUS auto update

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.