Create a script to install an Application from SCCM


  • Hello,

    I am on a mission to install a specific application, let's name it: NOVEMBER, in 200 Servers.  

    So far what I am doing is Login to the Server: run "change user /install" open SCCM, find the application "NOVEMBER", install, wait to be completed, "change user /execute", and that is it...

    We have SCCM team, and I think they can push the application to all the servers, but I need to run the change user /install command before the installation and they cannot do that for me.

    I was hoping to do this using PowerShell, <g class="gr_ gr_729 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="729" id="729">i</g> want to call the application using PowerShell, without opening SCCM, is it possible?

    What I have been doing is the following:  install NOVEMBER, copy the files located in CCMCACHE to a specific location, and run a script to install the MSI file from that particular folder, now the SCCM team mentioned that is not recommended. so... <g class="gr_ gr_1013 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="1013" id="1013">i</g> had to stop doing that.

    Any of you might have another alternative?

    SCCM Client Center

    Thank you

    • Edited by mcubac Wednesday, September 12, 2018 1:29 PM
    Wednesday, September 12, 2018 1:21 PM

All replies

  • OK so a couple of things.

    Are you sure you actually NEED to run the change user execute and install commands? If the thing you're installing is an MSI file the Windows Installer will take care of this for you as far as I understand it. I didn't think the change user commands were necessary from Server 2008 onwards (and nothing before that is supported by SCCM as a client anyway). Have you tried installing NOVEMBER without doing it?

    Assuming you do need to do it for some reason I can see at least a couple of ways of going about it.

    Create NOVEMBER as a Package in SCCM not an Application, define the source files to include the files for NOVEMBER plus a batch file which contains the "change user /install" command, then "msiexec /i NOVEMBER.MSI" then "change user /execute".

    Alternatively, create NOVEMBER as an application but rather than just deploy it deploy a Task Sequence with 3 steps. a "Run Command Line" step for install mode, an Install Application step for November and a final "Run Command Line" step for execute mode.

    Wednesday, September 12, 2018 1:57 PM
  • Hi,

    It seems we plan to push applications to RDS server through SCCM. 

    MSI installs DO automatically switch to Install mode when run (even deployed through SCCM). Other types of installs do not. 

    If the application is not in .msi format, we may try Philip's suggestion. In addition, as an alternative, we may try PSAppDeploy below to see if it works.

    PowerShell App Deployment Toolkit 3.7.0

    Hope the above information helps.


    Alex Zhu
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact
    Thursday, September 13, 2018 1:19 AM
  • Thank you both,

    I do not work in the SCCM team, and I asked for that specific thing but they "cannot" do it. 

    So my plan B was... find a way to call the MSI or SCCM Package without actually opening Software Center (SCCM).

    For example: to install the application "November", I need to open Software Center > Click: Find additional Application > an IE11 page will open > I will need to search the application NOVEMBER > Select the application > click INSTALL...   This will move the package to SCCM, and the installation will take place.

    It is not a long process, but when I have to do it on several servers, it is a time-consuming process.  I thought there might be a way how I can call SCCM and execute a package without opening SCCM.

    uhmmmm but the more I search, the more I do not see that is possible.  I think your option: creating another package that includes the 2 commands is the easier solution, but unfortunately, I cannot do it.

    Thank you

    Tuesday, September 18, 2018 9:09 PM
  • When you deploy applications you can make them available so users can install them from software center.

    Or you can make them required and schedule them to run at a specific time with no user interaction at all.


    Richard Knight | Collection Refresh Manager | Automate detection rules for patch \ msp files | Twitter

    Tuesday, September 18, 2018 10:39 PM
  • Hi,

    Yes, as per the above suggest, we can ask the SCCM team to put all the RDS server in a specific device collettion. After that, deploy the software to this collection as required.

    Hope the above information helps.


    Alex Zhu
    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact
    Thursday, September 20, 2018 7:13 AM
  • Thank you again,

    But I need to run two command lines before and after installing NOVEMBER in the Servers.

    I need to run

    change user /install, install NOVEMBER, change user /execute

    Yes, our SCCM Team told us that they can push the NOVEMBER to the servers, but we need to run those commands lines before.  So they did not give us more options than doing it manually.  
    I do not want to do it manually, so I was hoping to create a script to RUN "change user /install, install NOVEMBER, and change user /execute"  but the only problem is I don't find a way to install NOVEMBER!... 
    According to our SCCM team, (Software Center), there is no way to run/call an application from Software Center from a command line...
    Friday, September 21, 2018 7:05 PM