SCCM

SCCM 2012 – Detection Method for Update

With Configuration Manager 2012, you have a new feature to deploy your software: Application. To use Application, you need to add a Detection Method. This detection method is based on several criterias and it will check if the application is already installed on the computer.

SCCM included three built-in detections:

  • File/Folder: check if a file exists on the drive. Date modified, Version and Size can be used.
  • Registry: Check if a registry key exists.
  • Windows Installer: Check if a product code is installed.

Moreover, you can user another detection:

  • Custom script: write and execute you own script to detect the application. You can use Powershell, VBScript and JScript.

However, when you want to install a software update using Application, there is no built-in function to detect if the update is installed. You have to use a custom script.

Detection Method

To detect a software update, you can use Powershell and VBScript:

Detection Method - Custom Script

Powershell:

This is the powershell command:

get-hotfix | Where-Object {$_.HotFixID -match "KB2506143"}

Detection Method Powershell

Tips: if you want to use Powershell, you need to modify your client settings in order to ByPass Powershell execution policy.

Client Setting ByPass Powershell

VBScript:

'Returns if Windows KB2506143 installed
Option Explicit
Dim objWMI, strComputer
strComputer = "."
 
'Run the query
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &strComputer & "\root\cimv2")
 
Dim listPatches
Dim patch
Set listPatches = objWMI.ExecQuery ("Select * from win32_QuickFixEngineering where HotFixID like 'KB2506143'")
For Each patch in listPatches
Wscript.echo "Update installed"
Next
WScript.Quit

Detection Method VBScript

Verification

The file log AppDiscovery.log, in the CCM Logs folder, tracks the query execution for the application.
If you have an error in the query, you will find it in this log.

Before the installation of the application:

AppDiscovery Not Detected

After the installation:

AppDiscovery detectedMore

You can find more information about Application Detection Metod here.

 

Share

3 thoughts on “SCCM 2012 – Detection Method for Update

  1. Pingback: [ConfigMgr 2012] How to deploy a KB using Application - Alexandre VIOT

Leave a Reply

Your email address will not be published. Required fields are marked *