Create an SCCM application deployment with powershell

Create an SCCM application deployment with powershell

to create an SCCM application deployment with powershell you have to be patient, because the error output from the server is always “generic failiure”..
and there is not much help to get from Microsofts SMS_CIAssignmentBaseClass specification.

BUT! I had luck. A dude called Rob Looman already had most of the work published on his site. Thanks Rob 🙂

It took me a while to figure out how to make the specific deployments to be created properly because mandatory uninstalls didn’t work with Robs script.

But here it is, I hope it will save you some time!

An example of a deployment that needs to be available and not force install:


An example of a deployment that requires an install:


An example of a deployment that requires an uninstall:

There it is guys..

As always don’t hesitate to ask in the comment section!

Thanks

2 thoughts on “Create an SCCM application deployment with powershell”

  1. Hi,

    I am getting below error while executing the script. Please let me know what i am missing

    Error creating deployment: Cannot convert value “\\XXXX.XXX.XX\ROOT\sms\site_XXX:SMS_ApplicationAssignment” to type “System.
    Management.ManagementClass”. Error: “Invalid namespace “

    • Hi Karthik

      I just tested the script on my test environment, and it works fine. Are you able to list all applications with this query:

      Get-WMIobject -ComputerName SITESERVER -Namespace “root\sms\site_SITECODE” -query “select * from SMS_Application”

      Are you running this from the server or a client?

      Kind regards
      Morten

Leave a Reply to Karthik Cancel reply