Installing server updates with WAC

%3CLINGO-SUB%20id%3D%22lingo-sub-1060970%22%20slang%3D%22en-US%22%3EInstalling%20server%20updates%20with%20WAC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1060970%22%20slang%3D%22en-US%22%3EHi%20guys%2C%20can%20anyone%20share%20their%20experience%20with%20server%20patching%3F%20I%20have%202012R2%20to%202019%20VMs.%20If%20I%E2%80%99m%20installing%20updates%20via%20WAC%20there%20are%20two%20options%20-%20restart%20immediately%20and%20schedule%20restart.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20I%20install%20any%20patch%20and%20schedule%20the%20reboot%20the%20sever%20will%20always%20reboot%20immediately%20after%20patch%20installation.%20Even%20with%20all%20the%20patches%20with%20Reboot%20required%20NO.%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20basically%20I%20cannot%20use%20this%20approach%2C%20because%20I%20cannot%20set%20the%20severs%20to%20reboot%20over%20night%20if%20necessary.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20any%20input%20on%20this.%3CBR%20%2F%3EMartin%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1062793%22%20slang%3D%22en-US%22%3ERE%3A%20Installing%20server%20updates%20with%20WAC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1062793%22%20slang%3D%22en-US%22%3EI'm%20having%20this%20issue%20also.%20After%20installing%20update%20with%20a%20scheduled%20reboot%2C%20the%20server%20rebooted%20immediately%20after%20the%20updates%20were%20installed%2C%20not%20at%20the%20scheduled%20time.%20The%20server%20was%20a%20Hyper-V%20host%20so%20it%20took%20down%20ALL%20the%20VMs.%20The%20option%20chosen%20(reboot%20at%20a%20specific%20time)%20was%20not%20followed.%20Also%2C%20there%20should%20be%20an%20option%20to%20NEVER%20reboot%20after%20the%20updates%20are%20installed%20so%20that%20a%20controlled%20reboot%20can%20be%20performed%20manually.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1099931%22%20slang%3D%22en-US%22%3ERe%3A%20Installing%20server%20updates%20with%20WAC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1099931%22%20slang%3D%22en-US%22%3E%3CP%3ESame%20here%2C%20since%20updating%20to%20WAC%201910.%26nbsp%3BIf%20I%20select%20schedule%20restart%20and%20set%20a%20time%2C%20the%20server%20always%20reboots%20immediately.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20different%20browsers%2C%20but%20the%20behavior%20is%20consistent%20across%20browsers%20and%20Server%20OS%20versions%20(2012%20R2%20and%202019).%20I've%20also%20tried%20leaving%20the%20browser%20open%20to%20the%20update%20page%2C%20with%20the%20scheduled%20restart%20selected.%20It%20certainly%20behaves%20as%20if%20there's%20a%20bug%20in%20their%20code%20that's%20ignoring%20the%20scheduled%20restart.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1101730%22%20slang%3D%22en-US%22%3ERe%3A%20Installing%20server%20updates%20with%20WAC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1101730%22%20slang%3D%22en-US%22%3E%3CP%3EAfter%20a%20little%20digging%2C%20I%20think%20I%20know%20where%20the%20problem%20resides%2C%20but%20don't%20know%20where%20else%20to%20file%20a%20bug%20report.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20PS%20module%20named%20Microsoft.SME.WindowsUpdate%20defines%20the%20function%20%22Install-windowsUpdates%22%20with%20a%20parameter%20for%20%24restartTime.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20using%20WAC%2C%20the%20javascript%20takes%20your%20%24restartTime%20and%20generates%20as%20script%20using%20the%20Install-WindowsUpdates%20function%2C%20but%20gives%20it%20the%20restartTime%20in%20a%20format%20that%20is%20invalid%20for%20powershell.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExample%3A%3C%2FP%3E%3CP%3EThis%20line%20is%20from%20the%20PS%20script%20WAC%20created%20on%20the%20managed%20server%20to%20trigger%20the%20updates....%3C%2FP%3E%3CPRE%3E%24restartTime%20%3D%20'Fri%20Jan%2010%202020%2010%3A00%3A20%20GMT-0500%20(Eastern%20Standard%20Time)'%3B%3C%2FPRE%3E%3CP%3EThe%20function%20later%20uses%20%24restartTime%20in%20order%20to%20calculate%20a%20%24waitTime%20for%20shutdown.exe%2C%3C%2FP%3E%3CPRE%3E%24waitTime%20%3D%20%5Bdecimal%5D%3A%3Around(((Get-Date%20%24restartTime)%20-%20(Get-Date)).TotalSeconds)%3B%3C%2FPRE%3E%3CP%3EIf%20you%20simply%20run%3C%2FP%3E%3CPRE%3Eget-date%20-date%20'Fri%20Jan%2010%202020%2010%3A00%3A20%20GMT-0500%20(Eastern%20Standard%20Time)'%3B%3C%2FPRE%3E%3CP%3EIt%20throws%20an%20error%2C%20indicating%20this%20date%20string%20is%20invalid.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20they%20need%20to%20make%20sure%20the%20restartTime%20string%20passed%20from%20Javascript%20to%20Powershell%20is%20in%20a%20format%20powershell%20can%20work%20with.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1254015%22%20slang%3D%22en-US%22%3ERe%3A%20Installing%20server%20updates%20with%20WAC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1254015%22%20slang%3D%22en-US%22%3E%3CP%3EThere%20is%20currently%20a%20bug%20in%20the%20WAC%20until%20today%20and%20the%20scheduled%20restart%20does%20not%20work.%3C%2FP%3E%3CP%3ENote%3A%20The%20immediate%20restart%20works.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Efor%20more%20info%2C%20see%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwindowsserver.uservoice.com%2Fforums%2F295071%2Fcategory%2F319162%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwindowsserver.uservoice.com%2Fforums%2F295071%2Fcategory%2F319162%3C%2FA%3E%3C%2FP%3E%3CP%3EUntil%20this%20is%20fixed%2C%20here%20is%20a%20tip%20to%20have%20a%20script%20perform%20automatic%20windows%20update%20via%20the%20scheduled%20task%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechdirectarchive.com%2F2020%2F03%2F24%2Fhow-to-orchestrate-windows-update-with-powershell-and-task-scheduler%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftechdirectarchive.com%2F2020%2F03%2F24%2Fhow-to-orchestrate-windows-update-with-powershell-and-task-scheduler%2F%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1606076%22%20slang%3D%22en-US%22%3ERe%3A%20Installing%20server%20updates%20with%20WAC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1606076%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F457030%22%20target%3D%22_blank%22%3E%40MHampl%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWith%20WAC%20version%202017%2C%20the%20issue%20of%20scheduled%20rebooting%20has%20been%20resolved.%20If%20you%20have%20a%20different%20version%20of%20WAC%20running%2C%20kindly%20upgrade%20this.%20Here%20is%20a%20link%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechdirectarchive.com%2F2020%2F08%2F13%2Fhow-to-upgrade-windows-admin-center%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftechdirectarchive.com%2F2020%2F08%2F13%2Fhow-to-upgrade-windows-admin-center%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20require%20additional%20information%2C%20please%20let%20me%20know.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Visitor
Hi guys, can anyone share their experience with server patching? I have 2012R2 to 2019 VMs. If I’m installing updates via WAC there are two options - restart immediately and schedule restart.

If I install any patch and schedule the reboot the sever will always reboot immediately after patch installation. Even with all the patches with Reboot required NO.

So basically I cannot use this approach, because I cannot set the severs to reboot over night if necessary.

Thanks for any input on this.
Martin
5 Replies
Highlighted
I'm having this issue also. After installing update with a scheduled reboot, the server rebooted immediately after the updates were installed, not at the scheduled time. The server was a Hyper-V host so it took down ALL the VMs. The option chosen (reboot at a specific time) was not followed. Also, there should be an option to NEVER reboot after the updates are installed so that a controlled reboot can be performed manually.
Highlighted

Same here, since updating to WAC 1910. If I select schedule restart and set a time, the server always reboots immediately.

 

I've tried different browsers, but the behavior is consistent across browsers and Server OS versions (2012 R2 and 2019). I've also tried leaving the browser open to the update page, with the scheduled restart selected. It certainly behaves as if there's a bug in their code that's ignoring the scheduled restart. 

Highlighted

After a little digging, I think I know where the problem resides, but don't know where else to file a bug report.

 

The PS module named Microsoft.SME.WindowsUpdate defines the function "Install-windowsUpdates" with a parameter for $restartTime. 

 

When using WAC, the javascript takes your $restartTime and generates as script using the Install-WindowsUpdates function, but gives it the restartTime in a format that is invalid for powershell.

 

Example:

This line is from the PS script WAC created on the managed server to trigger the updates....

$restartTime = 'Fri Jan 10 2020 10:00:20 GMT-0500 (Eastern Standard Time)';

The function later uses $restartTime in order to calculate a $waitTime for shutdown.exe,

$waitTime = [decimal]::round(((Get-Date $restartTime) - (Get-Date)).TotalSeconds);

If you simply run

get-date -date 'Fri Jan 10 2020 10:00:20 GMT-0500 (Eastern Standard Time)';

It throws an error, indicating this date string is invalid. 

 

So they need to make sure the restartTime string passed from Javascript to Powershell is in a format powershell can work with. 

Highlighted

There is currently a bug in the WAC until today and the scheduled restart does not work.

Note: The immediate restart works. 

 

for more info, see https://windowsserver.uservoice.com/forums/295071/category/319162

Until this is fixed, here is a tip to have a script perform automatic windows update via the scheduled task https://techdirectarchive.com/2020/03/24/how-to-orchestrate-windows-update-with-powershell-and-task-...

Highlighted

Hi @MHampl ,

 

With WAC version 2017, the issue of scheduled rebooting has been resolved. If you have a different version of WAC running, kindly upgrade this. Here is a link https://techdirectarchive.com/2020/08/13/how-to-upgrade-windows-admin-center/

 

If you require additional information, please let me know.