SCCM: Extending Max Run Time on Windows Server 2016 Updates

So I’ve recently put together a quick script to extend the maximum run time of the Windows Server 2016 Cumulative Updates as we’ve found occasionally that the default run time isn’t enough for these updates.

I’ve provided the script below which you can save as a .ps1 and run on your SCCM primary site server. As it is it sets the run time to 90 minutes, however you can set it to whatever you like. Bear in mind however that you may have to adjust your device collection maintenance windows for the new run time because the SCCM client will not install any updates if it cannot find a maintenance window which is long enough to install all of it’s pending updates.

If you wanted to try and automate the process you could run the ps1 on a scheduled task once every month after your software update point has synchronised with Microsoft. However it will need to run before your ADR’s run so when the deployments are created by the ADR’s, the new run time will be effective on clients.

 

$SiteCode = “SCCM SITECODE”
$ProviderMachineName = “FQDN OF SCCM PRIMARY SITE SERVER”

Import-Module “$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1”

New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $ProviderMachineName

Set-Location “$($SiteCode):\”

Get-CMSoftwareUpdate -Fast -DatePostedMin (get-date).AddDays(-30) | where LocalizedDisplayName -match ‘.*Cumulative Update for Windows Server 2016.’ | Set-CMSoftwareUpdate -MaximumExecutionMins 90

 

This is a follow up to my colleagues blog about Windows Server 2016 updates failing via SCCM which you can find here.

Hope it helps! 🙂

About the author