Executing commands on remote windows from linux terminal

Executing commands on remote windows from linux terminal

Execute remote commands between Linux systems is something common, but What happen when you want to execute  commands on remote Windows from Linux terminal ?

Probably you already know how good is CollectNode executing any kind of command in remote Unix/Linux systems, but maybe you didn’t know is that now CollectNode is available to do the same in remote Windows systems, so let’s have a look how to do it.

If you are new on CollectNode just let you know there is a free version, totally functional, CollectNode can be installed and configured in almost any Linux system in a couple of minutes, and start managing your remote systems in a very easy way.

Let’s start

First of all, we create the list of Windows server we are going to work with:

To let CollectNode know we are going to work with Windows nodes, we have to configure the parameter nodetype, in this case lets just overwrite the parameter at hosts.file, so we put all server in a group, and define the variable nodetype for this group.

If it is the first time using CollectNode, you need to configure the credentials for Windows, for that purpose we use the following command:

The Windows credential to configure are easy, we have to write the username, password, the domain or realm if the user is part of, and the transport mode, ntlm is less secure than kerberos, but works fine with domain and not domain credentials. CollectNode use WinRM to connect to Windows nodes, if WinRM is configured by default, probably you have finished the windows credential configuration. If you are using CollectNode the first time, please have a look to install and configure. To see all CollectNode parameter can be configure to Windows nodes or how to configure with kerberos, see configuring for Windows

If you are going to use HTTP endpoint and loose confidentiality in your messages you will need to enable unencrypted messages in the Windows nodes by running the following command in all of them, by cmd:

That’s all!

We are ready to use CollectNode with Windows nodes, for instance I am going to check the operating system and version these servers have installed, using the command --os

Executing commands on remote windows from linux terminal 01

Get CollectNode now !

Leave CollectNode to make the hard work, and spend your time where really matters.

Pin It on Pinterest