Run Scripts with Parameters in MEMCM (R.I.P. SCCM)
How do you use Parameters on the Run Scripts feature? You get three guesses, but the first two don't count. That's right, you create a script with standard PowerShell Parameters and you build it out in MEMCM. In your MEMCM console, navigate to Software Library > Overview > Scripts. If you're not familiar with Run Scripts in MEMCM, check out my previous Blog articles on it.
Click on Create Script. In the Create Script Wizard that pops up input a Script Name, pick between PowerShell or PowerShell in your Script Language, import or paste in your script with Parameters, and click on Next.
My demo script for this article (scroll alllll the way down, it's at the bottom) is about an 8 out of 10 on the cool factor, and about a 3 out of 10 on the usefulness factor. Long story short, the script will make a computer talk. There are two Parameters that you can input, one for "what do you want to say?" and the other for "who is your message from?" both of which are spoken. The script sets a computer's volume to 80%, says what time it is, makes a snarky remark about the time of day, says your message (the first parameter), and then it says who the message is from (the second parameter).
The next screen in the Create Scripts Wizard shows you the Parameters from your script. You can highlight a Parameter and click on Edit if you want to change anything on it.