Can I have scripts prompt me for input?

If I am running a procedure like “rename computer” on a single machine, can I set it so the script will prompt me for the computer name instead of having to clone/edit the script and then manually typing in the computer name into the script?

There are a lot of one-time scripts that I would like to use but the idea of having to manually edit them each and every time just for a single instance is really frustrating.

@nswetland ,

Your request indeed has a vital point. We have reached out to our Scripts team for your request and we’ll provide you an output of their feedback as soon as possible.

@nswetland ,

As of the current capability of our Scripting process. Your request is not feasible. The prompt can only be triggered on the endpoint where the “rename computer” has been run. It means that the prompt will appear to the end user who has logged in the computer, not for the one who has triggered the script from the Endpoint Manager Portal’s side. Thank you for waiting for our response.

Why not use the parameters functions of scripts meaning you run it on a single PC and specify the name at the point of running it?

@StrobeTech that’s exactly what we do. Clone the script and then change the hard-coded variable to a parameter.

@nswetland - In your example of renaming a PC, the first line of the script is changed from:

NewCompName = ‘ComputerNoSpaceName’ ## Enter your computer name with out any space to change the target computer


NewCompName = itsm.getParameter(‘NewCompName’)

As soon as you add the itsm.getParameter() function, the platform recognises that a parameter is required and adds the Parameters section to the procedure’s edit screen so you can set up the message and input…

One note about this particular script is that it forces an immediate reboot on completion, so you may want to amend that too.

Appreciate the reply (sorry for delayed response, my forum emails were going to spam)

I will give this a try and see how it goes!