can someone suggest me a method how I can execute in Jenkins Declarative Pipeline remote windows commands (e.g. using the cmd or powershell) with some already existing Jenkins Plugin? The remote machine is not an agent, but the machine where some deployment using the FTP is being done after which I need to execute command for Windows Service restart.
How this can be achieved? I thought that maybe WinRMClient plugin can be used for these purposes but I cannot execute it on my Linux docker agent (I have a separate topic open for this issue.)
I would be thankful for useful hints!
Thanks a lot
I don’t think you need (or want) a dedicated plugin for that task. If you can execute a command from Linux that runs something on your Windows computer, then you can run that command inside a Jenkins Pipeline. Some examples of techniques that are available to run a Windows command remotely from Linux include:
Secure shell - install and configure Microsoft’s OpenSSH server on your Windows computer, use ssh to start Windows programs from Linux
winexe - install Linux winexe command and use it to start Windows programs from Linux
xfreerdp - install Linux xfreerdp command and use it to start Windows programs from Linux
Mark, thanks a lot for your very kind assistance. I wen through the links you provided me and I was wondering if you have some additional link with instructions for the: SSH installation and configuration for OpenSSH on windows. I suppose that assumes that we need to generate some keys, certificates, exchange files etc. Would it be possible to give me the best link which describes these steps in details? Thanks!!!