One of the very need features in the new Application model is Global conditions. A Global condition is a requirement rule that is evaluated in real time by the client. The client will only start downloading the application if the global condition is true.
ConfigMgr. 2012 ships with several global conditions like memory, operating system, primary user etc. Those conditions are pretty useful and can be used right out of the box.
Besides the canned conditions, creating custom conditions can be very powerful and all you need is a few steps to get your started. In this post, I’ll explain how you can create a global condition based on WMI that can be used when deploying applications to specific hardware models. For the sake of testing I have created an Application that must only be installed on all Lenovo W510 laptops.
Creating a WMI condition
My global condition will query WMI prior to downloading the application and verify that the computer model matches a Lenovo W510. In order to figure out which WMI class to use, I have downloaded Scriptomatic from Microsoft.
When selecting the Win32_computerSystem class I can see that the property I’m looking for is “Model”.
- Next is creating the condition, open the ConfigMgr. administrator console, select Software Library, Application Management, Global Conditions and click Create Global Condition from the ribbon.
- Create a condition with these settings:
Name: Computer model
Device type: Windows
Condition type: Setting
Setting Type: WQL query
Name space: root\cimv2
Configuring the application to use the global condition
- Select the Application - in my example 7-ZIP and open the deployment type properties.
- Click Requirements
- Click Add and configure these settings
Condition: Computer model
Rule type: Value
Value: 431929G (that’s the computer model name found with Scriptomatic)
- Click OK and save the changes.
Testing the global condition
Prior to installing the application, I will create a simulated deployment and use that to verify if my global condition is working.
- Right click the Application and select Simulate Deployment.
- Select a target collection, the Install action and finish the deployment.
- A simulated deployment is almost a real deployment except that the user will never notice anything and that the application is never installed. All the dependencies and requirements rule are checked. ´
- Open the Monitoring workspace, select Deployments and have a look at the results from the simulated deployment.
- Click View Status to get more information about the simulation.
- I have 1 successfull test deployment and the rest do not meet my requiement rule.
- Click Requirements Not Met. Notice that is show the Actual Value of the WMI property, very nice.