Microsoft

System Center Configuration Manager Feedback

Suggestion box powered by UserVoice

How can we improve Configuration Manager?

Powershell cmdlet for adding global conditions as requirements

We are using PowerShell as a frontend for creating applications. As default we create multiple deployment type, each of them intented to run in certain environemts. These environemts are defined in some custom global conditions.

When creating the deployment type we can very easily identify which global contitions shold be set as requirement. But we miss a Powershell cmdlet to automize this task. Instead we rely on the application creator to remember to add these conditions.

So far I have found a PS-script that can add one of the build-in conditions, but it fails when trying to add a custom made condition.

37 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Mads Nyberg shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Chaitanya commented  ·   ·  Flag as inappropriate

        Could you please let us know if the feature asked by Mads Nyberg has been addressed or not.

        If yes, please provide us the reference link or notes to move further. Why because we are automating the SCCM application deployment process through powershell but no where i could be able to find out the powershell script for adding Custom made requirement condition in an Application deployment type.

      • Alexander Hefele commented  ·   ·  Flag as inappropriate

        Hi @Adam Meltzer,
        as there is a Get-CMGlobalCondition cmdlet maybe it is a good Idea only add a "Rule" Property for this cmdlet

        On the current Set-CMDeploymentType cmdlet there is the ability to add a Requirenment by -AddRequirement an the type "Rule" is recommenden (a DCM-Rule as i know).

        If you add this type to Get-CMGlobalCondition we can use it like:

        $condition = Get-CMGlobalCondition -Name "TestCondition"
        Set-CMDeploymentType -ApplicationName "TestApplication" -AddRequirement $condition.Rule

      Feedback and Knowledge Base