How Do You Run a Bolt Command from a Linux Server to a Windows Server?

Problem scenario
You want to run a PowerShell script or run an interactive command on a Windows server. You have Puppet Bolt installed on a Linux server. You do not need to use SSL. What do you do?

Run a command like this (but substitute x.x.x.x with the IP address of the Windows server, jdoe with the username and coolpassword with jdoe's password):

bolt command run "Get-Process" --Targets winrm://x.x.x.x --no-ssl --user jdoe --password coolpassword

To run a script called "cool.ps1", create a Powershell script on your Linux server named cool.ps1. Then run this command:

bolt script run cool.ps1 --Targets winrm://x.x.x.x --no-ssl --user jdoe --password coolpassword

Leave a comment

Your email address will not be published. Required fields are marked *