The CreatorCon Call for Content is officially open! Get started here.

Run powershell command from UI action button

Abhishek64
Kilo Contributor

I have created a UI action button on Incidents based on the category. Now i want to execute some PowerShell command/scripts from UI action button. Please let me know how can we run PowerShell command/script from UI action.

I want script which i can put in the script tab in UI action.

Example - 

When i clicked on mailbox_update button below poweshell command should execute and it will asked for the input like mailbox name where i can provide the name HR@abc.com or it will open a form where i can provide the input 

find_real_file.png

find_real_file.png

 

find_real_file.png

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

powersheel commands get executed on mid server or windows machine and not directly within ServiceNow

you can ask user to input using prompt box and then in server side of the UI action invoke the mid server script which will do the powershell task

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Could you please help me with the steps to achieve it ?

check this out

PowerShell Utility V2 - execute Powershell scripts directly from your instance

Calling PowerShell script on MID server

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader