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.
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.
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.
@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
to:
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.