You can run this as a package 30 minutes before the maintenance window or
before the updates:
If
((([WMIClass]"root\ccm\ClientSDK:CCM_ClientUtilities").DetermineIfRebootPending()).RebootPending
-eq $true) {shutdown /r}
This basically asks the CM Client if there is a reboot pending, and if
there is, it restarts the computer.
On Wed, Jul 2, 2014 at 1:32 AM, Corkill, Daniel <
[email protected]> wrote:
> I want to advertise a script to servers during our maintenance window,
> 30mins prior to the updates deadline, that will check for reboots pending
> on the box and if there are any, reboot it.
>
>
>
> I’ve found the get-rebootpending PS script here:
> http://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542#content
> but it’s unclear to me whether this will pickup reboots pending from new
> device installs, which is important to us. Someone asks for this
> functionality in the comments but it’s never subsequently mentioned. There
> also doesn’t appear to be anyway to use this script to trigger a reboot if
> one is pending.
>
>
>
> Is anyone else using something similar?
>
>
>
> Daniel.
>
>
>
>
>
>
> *********************************************************************
> This email, including any attachment, is confidential to the intended
> recipient. It may also be privileged and may be subject to copyright. If
> you have received this email in error, please notify the sender immediately
> and delete all copies of the email. Any confidentiality or privilege is not
> waived. Neither the Council nor the sender warrant that this email does not
> contain any viruses or other unsolicited items.
>
> This email is an informal Council communication. The Council only accepts
> responsibility for information sent under official letterhead and duly signed
> by, or on behalf of, the Chief Executive Officer.
>
> Privacy Collection Notice
> Logan City Council may collect your personal information, e.g. name,
> residential address, phone number etc, in order to conduct its business
> and/or meet its statutory obligations. The information will only be accessed
> by employees and/or Councillors of Logan City Council for Council business
> related activities only. If your personal information will be passed onto a
> third party, Council will advise you of this disclosure, the purpose of the
> disclosure and reason why. Your information will not be given to any other
> person or agency unless you have given us permission or we are required by
> law.
>
>
>
>
>