Jump to content

Scheduling Windows Update


Lambuerto

Recommended Posts

Ok, So I am trying to schedule Windows updates for some of our clients using the web app. However the only option it gives me is to install them immediately (At least to my understanding.) Is there any feature that lets me schedule them during a down time such as late at night.

Link to comment
Share on other sites

13 minutes ago, Paul said:

Hi,

Scheduling windows updates isn't supported as of now however this will be possible in the upcoming patch management module (should come in Q1-Q2 2017).

-Paul

Would this be possible to run as a scheduled task using a Powershell Script?

Link to comment
Share on other sites

At the risk of stealing his thunder, I had Paul Csiki from Pulseway Support provide me the following PowerShell script a day or two ago in answer to this exact question. This should allow you to run the script at certain times using the automation features. I haven't yet tested it but on read through I like what I see.

As Paul says, I hope it helps.

 

Email contents copied below:

 

 

Hi Jimmy,

You can use this PowerShell script to install available Windows updates through the Pulseway automation feature:

Write-Host "Start Windows Update"
    $UpdateCollection = New-Object -ComObject Microsoft.Update.UpdateColl
    $Searcher = New-Object -ComObject Microsoft.Update.Searcher  
    $Session = New-Object -ComObject Microsoft.Update.Session  
      
    $Searcher = New-Object -ComObject Microsoft.Update.Searcher  
    $results = $searcher.search("Type='software' AND IsInstalled = 0 AND IsHidden = 0 AND AutoSelectOnWebSites = 1")  

    # Install Update
    if ($results.Updates.Count -eq 0) {
        Write-Host "No Update"
        # no updates.
    } else {
        # setup update collection
        foreach ($update in $results.Updates){
            $UpdateCollection.Add($update) | out-null
        }

        # download update items
        Write-Host "Download update items"
        $Downloader = $Session.CreateUpdateDownloader()
        $Downloader.Updates = $UpdateCollection
        $Downloader.Download()

        # install update items
        Write-Host "Install update items"
        $Installer = New-Object -ComObject Microsoft.Update.Installer  
        $Installer.Updates = $UpdateCollection
        $InstallationResult = $Installer.Install()
        # Check Result
        if ($InstallationResult.ResultCode -eq 2){
            Write-Host "Update Success"
        } else {
            Write-Host "Some updates could not installed"
        }
        if ($InstallationResult.RebootRequired){
            Write-Host "System needs to reboot."
        }
        Write-Host "Finish Windows Update."
    }

I hope this helps.


Regards,
Paul Csiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...