Run powershell command from UI action button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 09:01 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 09:19 PM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 09:27 PM
Could you please help me with the steps to achieve it ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 09:30 PM
check this out
PowerShell Utility V2 - execute Powershell scripts directly from your instance
Calling PowerShell script on MID server
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader