SOLVED

WAC Scheduled reboot for Windows Updates installation not working.

Copper Contributor

Hi guys,

 

I've encountered an issue about scheduled reboot for windows updates installation via WAC.
If I install any patch and schedule the reboot the sever will always reboot immediately after patch installation. 

After some 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-WACWUWindowsUpdates" with a parameter for $restartTime. 

 

When using WAC, the javascript takes your $restartTime and generates a script using the function stated before, with the restartTime value in en-US regional date format. Problem is, our servers are using Italian Regional format data because they're located in Italy. Thus, the date difference fails and so the server reboots immediately.

 

Example:

 

This line is from the PS script WAC created on the managed server to trigger the updates, the scheduled reboot time is stated as below:

$restartTime = 'Thu Mar 28 2024 19:49:50+0100';

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

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

This difference between date items is failing because the output of the command "Get-Date" in our servers is localized in Italian:

 

giovedì 28 marzo 2024 17:21:38

This means that the scheduled reboot feature will not work for all servers where regional format data is not the same as the "en-US" standard.

 

I've also tried to elaborate some fix, using the "-Format" option for the Get-Date command:

$currdate = Get-Date -Format "u"
$convRestartTime = Get-Date $restartTime -Format "u"
$waitTime=[decimal]::Round((New-TimeSpan -Start $currDate -End $convRestartTime).TotalSeconds)

Trying to simulate my fix, there is no error and the difference between the dates is consistent to the reboot time indicated in the web GUI.

 

Can someone make this feedback reach the developers of the update extensions in WAC?

Do you have any other suggestion about this issue? 

 

Thanks for any input on this.


Alessandro

4 Replies
best response confirmed by Karl_Wester-Ebbinghaus (MVP)
Solution
Hi!
Thanks for bringing it up.
I've created a bug for investigation on this (49779131).
Hi,
Thanks for your reply.
Is there any way to follow the investigation about this issue, gived the bug number?
Have a nice day!
Hi, yes, I can give updates here and if you have any questions you can just reply and I'll see it. :) I hope this is OK with you? As of now, I have logged the bug and it has been assigned to someone for investigation.
Hi,
Thanks for the clarification! I'll wait for some updates from you then, hoping to see this issue fixed in the next updates.
1 best response

Accepted Solutions
best response confirmed by Karl_Wester-Ebbinghaus (MVP)
Solution
Hi!
Thanks for bringing it up.
I've created a bug for investigation on this (49779131).

View solution in original post