Execute PowerShell Script using remote-shell-script runner

Hello All

We are using openssh in windows for password less connectivity from stack storm server and hence I can’t use winrm action runners.

I need to run powershell scripts and they fail from remote-shell-script.

Stderr : “‘export’ is not recognised as internal or external command, operable program or batch file”

Is there any way to execute power shells script from remote-shell-script runner.

Running SSH onto windows is very special and is not supported by StackStorm. I highly suggest looking at Bolt which allows you to describe the login-shell of the remote target as PowerShell: https://puppet.com/docs/bolt/latest/bolt_transports_reference.html#login-shell

There is also a StackStorm pack for Bolt here: GitHub - StackStorm-Exchange/stackstorm-bolt

2 Likes

Thanks for the prompt response, I’ll check it out.

We are using key based authentication due to security concerns ie to avoid storing password.
Let’s say we go with password based authentication. What are the options we have except for the 2 I found in another discussion ie Secrets and Vault(3rd party) ?

Is there any other default feature of ST2 to handle passwords of say1000s of server with security being the primary concern.

After some hands on, I felt winRM is better for windows rather ssh.
We can use secrets for storing password or better approach is to use Active Directory.
with Kerberos setup, we don’t need to use/store password anywhere.

Thank you @nmaludy, You’ve been a great help.