-
1. Re: How to call Power shell script from Remedy
Joseph Ruiz Jul 13, 2017 10:29 AM (in response to Karthikeyan Venkatesan)1 of 1 people found this helpfulYes, there is a way:
- Create a PowerShell (.ps1) script and place it on each AR Server in your cluster in the same folder location.
- Ensure the AR service account can read/write the the folder on each server.
- Create a new Filter that executes the script based on a condition.
- Example: ('Summary' LIKE "XYZ Deployment Request") AND ('WO Type Field 01' != $NULL$)
- Set z1D Char29 to "'" to create an object-based null variable.
- Set the z1D Char30 field to the location of the PowerShell script with any parameters needed to run it.
- Field = z1D Char30
- Value= (((("""c:\Location\script.ps1""" + " ") + $z1D Char29$) + $WO Type Field 02$) + $z1D Char29$) + " ")
- (Optional) Add a message Action to display the running script.
- Type: Note
- Text: $z1D Char30$
- Add a final run process command of "PowerShell -Command "& {$z1D Char30$}""
-
2. Re: How to call Power shell script from Remedy
Karthikeyan Venkatesan Jul 21, 2017 1:00 AM (in response to Joseph Ruiz)Dear Joseph,
Many thanks for your response. I will try this approach.
Regards,
Karthik
-
3. Re: How to call Power shell script from Remedy
Levi Lippincott Jul 31, 2018 4:08 PM (in response to Joseph Ruiz)Hey Joseph,
I followed your instructions and I end up getting an error message: "The Run Process active link action failed because this Run Process command was used incorrectly. (ARERR 9366)"
The Run Process action in the logs show: Run Process: "PowerShell -Command "& {$1000003684$}""
The value of that field is: "D:\temp\test.ps1" which I display in the action step right before the Run Process attempts to fire.
Any pointers would be appreciated!
I created a separate thread for this since your reply is over a year old and if you don't reply that's fine I will keep both updated.
Calling Powershell Script via Active Link
Thanks,
Levi
-
4. Re: How to call Power shell script from Remedy
rodrigo barcatJan 10, 2019 9:47 AM (in response to Joseph Ruiz)
Hi Joseph Ruiz, hope you are doing well.
Can you help me with the script. I create the file bmc_unlock_ad.ps1
When I try to run on Powershell (without param), it is running as welll. But when I run it from Remedy or CMD nothing happens
Param([string]$user)
Get-ADUser -Filter {mail -like "$user"} | Unlock-ADAccount | Sync-ADObject -Destination "AZUDCMO01"
Thank you
-
5. Re: How to call Power shell script from Remedy
Joseph Ruiz Jan 10, 2019 9:53 AM (in response to rodrigo barcat)You may want to start this question on a new thread to get better help.
As a start though, what is returned when you run Powershell Get-ExecutionPolicy from the server?
-
6. Re: How to call Power shell script from Remedy
rodrigo barcatJan 10, 2019 9:58 AM (in response to Joseph Ruiz)
It returns RemoteSigned
-
7. Re: How to call Power shell script from Remedy
Joseph Ruiz Jan 10, 2019 10:03 AM (in response to rodrigo barcat)That might be your problem. RemoteSigned means your script needs to be signed with some hashed key in order to run on another server. Ours is set to Unrestricted.
- Set-ExecutionPolicy link from MSFT
-
8. Re: How to call Power shell script from Remedy
Joseph Ruiz Jul 17, 2019 12:21 PM (in response to Joseph Ruiz)1 of 1 people found this helpfulDid this help you out at all?
-
9. Re: How to call Power shell script from Remedy
rodrigo barcatJul 17, 2019 12:26 PM (in response to Joseph Ruiz)
1 of 1 people found this helpfulOn case that I developed worked like a cham.