Recently I was asked by a colleague if System Center Configuration Manager had a way we might test for the presence of a running application prior to attempting to install a piece of software. Giving it a bit of thought I came up with a simple method leveraging ConfigMgr 2012’s new global conditions ability. Global conditions are requirement rules that are evaluated in real time on the client prior to attempting any software downloads/installs.
In my example, I wanted to ensure that Internet Explorer was not running. A simple PowerShell script provided the necessary results, but I needed to ensure I had the correct process name first.
Next I tested my script [bool] (Get-Process iexplore -ea 0)
Time to create our global condition in ConfigMgr. From an admin console, navigate to the Software Library -> Application Management -> Global Conditions and choose Create Global Condition from the ribbon bar.
Enter your relevant information in the resulting dialog box
Click on the ‘Add Script’ button and enter in your line of code:
Click OK twice and now you have your new global condition.
At this point, you may now reference this condition and use it as a requirement test for any of your deployment types where it is applicable.
In my example, I created a new requirement for a Java 7 Update 15 deployment type. I clicked ‘add’ on the ‘Requirements’ tab and entered the following in the resulting dialog box.
Click OK and you are all set.
That is all there is to creating and using a global condition in the new application model in ConfigMgr 2012. Hopefully this quick example gives you an idea of how to leverage global conditions.