SCCM 2012 – Application Detection Method for Windows Update files (.msu) using PowerShell

I needed to package and deploy Remote Server Administration Tools (RSAT) for IT staff using SCCM 2012 R2.

Deploying the software is easy, detecting the installed update was a bit different. Not entirely difficult but noteworthy.

1. Setup the application with the unattended silent install of the .msu update

wusa.exe KBxxxxxx.msu /quiet /norestart
2. In the detection method tab, set the option to “Use a custom script to detect the presence of this deployment type” and click “edit”

3. Change the script type to PowerShell and enter in the cmdlets

get-hotfix | Where-Object {$_.HotFixID -match “KBxxxxxx”} 

The deployment should now be good to go. If you run into any execution policy errors or script not signed, you’ll need to change the PowerShell Execution Policy to bypass on the SCCM agent client settings.

2 responses to “SCCM 2012 – Application Detection Method for Windows Update files (.msu) using PowerShell”

  1. Dustin Avatar
    Dustin

    The Powershell script works, however I noticed that on some of the sccm deployments the monitoring shows as Error > Error Code 0x240006 (2359302) – The update to be installed is already installed on the system. Any suggestions on how to modify it so that it reflects as success?

    1. Scripters Avatar
      Scripters

      By design, if the detection method is correct then SCCM should not install the application. I’d remote to one of the failing machines and run Get-Hotfix in elevated Powershell and see if the hotfix is actually installed.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.