none
SCCM 1902 and deploy Powershell script with parameter RRS feed

  • Question

  • Hi,

    I want to deploy a power shell script using SCCM-->Script. I know how I can create and approve it.

    My Powershell script is runing with parameter as following:

    .\rebootmachine.ps1 -Config .\configpgrade.xml

    I am not sure how can import it or create a new one in SCCM with parameter.

    How and where can I put .\configpgrade.xml?

    BR,

    Keywan

    Monday, October 7, 2019 1:02 PM

Answers

  • I know I can create a Package and deploy it. The script is easier as Package. Anyway thanks for help.
    • Marked as answer by mpng2008 Monday, October 7, 2019 1:53 PM
    Monday, October 7, 2019 1:53 PM

All replies

  • Your xml is a separate file, you cannot use that there. Create a Package instead. 
    Alternatively if you want to call your xml from the script, you need to put it in a share or so where the Computer you're targeting has access.

    Any other case you would need to embed the xml contents inside your script.

    As for the location to put the parameter, just write the value where it says 'Default Value'


    Monday, October 7, 2019 1:19 PM
  • Hi Keywan,

    I don't think if you can deploy a script with a XML configuration file directly with the new feature starting with SCCM 1802, waiting for a Microsoft member to confirm or not that.

    Btw, why not create a simple Package with a content that has the Powershell script and the XML configuration file, then deploy the package on the desired device collection. This method don't give a real-time result but you are sure that offline clients will receive the deployment once started.

    For more details about creating and deploying PS script with SCCM: https://docs.microsoft.com/en-us/sccm/apps/deploy-use/create-deploy-scripts

    Regards,

    SAAD Youssef

    ______

    Please remember to mark the replies as answer if they help, thank you!

    • Proposed as answer by SAAD Youssef Monday, October 7, 2019 1:54 PM
    Monday, October 7, 2019 1:28 PM
  • I know I can create a Package and deploy it. The script is easier as Package. Anyway thanks for help.
    • Marked as answer by mpng2008 Monday, October 7, 2019 1:53 PM
    Monday, October 7, 2019 1:53 PM
  • Hi,

     

    Thank you very much for your feedback! Here's a short summary for the problem.

     

    Problem/Symptom:

    ===================

    Problem details: 

    How to deploy Powershell script with parameter 

     

     

    Solution:

    ===================

    Create a Package and deploy it


     

    Best regards,

    Larry


    Please remember to mark the replies as answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, October 8, 2019 9:44 AM