Deploy PowerShell Script using SCCM

Pre-release feature In the SCCM 1706. Beginning with version 1802, this feature is no longer a pre-release feature, we get a new ability to deploy script using SCCM, we can create, edit, and import existing scrips.
Well, We could deploy some scripts via Package, Application deployment as well, but right now we have intended feature for this demand.

For my demonstration, I am going to deploy “Maintenace Windows“, I have prepared this PowerShell WIndow and revise it according to my article:

SCCM PowerShell supports on:
Parameter types: integer, string, and list.


Clients must be running PowerShell v3.0+

Open the SCCM Console management go to your Administration > Site > Hierarchy Setting:

Go to “Administration” > “Updates and Servicing” > “Features”
Make sure “Create and run script is turning on”:


Go to “Software Library“:


Import your script and set a name:


The script is ready, but it’s waiting for approval, by the way, in a case, the “Approval” is as grayed out it means that you haven’t unchecked the “Script authors require additional script approval” option in the previous settings on “Hierarchy Setting”:


Once you approve it you get the following window:
Proceed with next:



The approve or deny script completed successfully:

Let’s run the script:
Go to “Assets and Compliance” and then right click on the preferred collection and “Run Script“:

Select your script:

Deploying is in-progress…


We want to monitor the deployment right?, so we should navigate to “Monitoring” > “Client Operation“, and here we can see the script deployment status:

You can go over the “ScriptStore” log file on “C:\Windows\CCM\ScriptStore”

You can see the downloaded script on:
Maintenance message deployed successfully, the client gets the following message:

  1. Rechov Hanevi'im 2 years ago

    Used the directions you provided to test a PowerShell script in SCCM. Thanks for the inforamtion.

    • Robert Charalambous 1 year ago

      Seems to need an update since SCCM 1902 runs scripts with -NonInteractive switch and users can’t see the MessageBox even though the script executes fine. Please help 🙂

  2. Danny Jeronimo 1 year ago

    Thanks Meir for the information. I tried running the script through SCCM but nothing popped up on the client computer. I checked the log file, but there are no obvious errors.

Leave a Comment

Your email address will not be published.

Comment moderation is enabled. Your comment may take some time to appear.

In the news
Load More