Reputation: 415
How do you setup Jenkins running on Linux to execute a PowerShell script on a remote Windows Server 2008 without password prompt.
Master Jenkins on Linux / Slave on Windows. Would this work?
Upvotes: 2
Views: 5561
Reputation: 141
EDIT
A complete edit, since I couldn't get the previous answer working.
$username = "username" $secpass = ConvertTo-SecureString "password" -AsPlainText -Force $mycreds = New-Object System.Management.Automation.PSCredential ($username,$secpass) $remotepath = "c:\path\to\your.ps1" Invoke-Command -ComputerName windowscomputer -Credential $mycreds -FilePath $remotepath
powershell -NonInteractive -ExecutionPolicy ByPass /path/to/your/local.ps1
This is how I got it working eventually.
Upvotes: 1
Reputation: 4650
Install an SSH server on the Windows server and use a public/private key pair for authentication. On Linux, you can then run
ssh -i <private key file> user@host "command"
to issue "command" on the server.
Upvotes: 1