Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Execute PowerShell Script on MID-Server

Justin Wenner
Tera Expert

Hello,

how i can execute a powershell script directly on the mid server and not on a remote host.

I would like to execute the script in a Flow Designer Action but a host is required. And i can't add the MID Server Hostname because the connection is not working (Error: PowerShell script execution failed. Script returned status 1 using account user xxx) and i have multiple MID Server in one failover cluster.

 

Questions:

  1. How i must create the connection alias, connection and credentials for authentication to run the ?
  2. How i configure a example script?
  3. Which is the prefered way to execute powershell scripts on the mid

 

Best regards

Justin

2 REPLIES 2

jonsan09
Giga Sage
Giga Sage

I would recommend taking inspiration from existing spokes that leverage powershell, a perfect example would be any of the AD/Active Directory spokes. 

Thanks for your answer. But in the ad spoke is the domain controller configured.  And the connection is being build to the host

 

That is another topic but i also dont like this. We have multiple domain controller, if one is crashed. And there i configured a static domain controller.