Windows or Linux probe or operation or flow

Hi all,

i need to restart service or kill process on remote host. To know which command to execute on remote host i need to know is OS Linux or Windows.

Is there any operation or flow that can help me?

Or if there is not how you probe if remote host is Linux or Windows.

  • I found it:

    /Base [1.14.0]/Library/Operations/Operating Systems/Windows/Operating System Detector

    It works for Windows remote host even when port 22 is not open (I did not change default port setting)

    I have only Remote Power shell (5985) and WMI (445) port open to remote host. And user in Administrators group.

    Did not tested for Linux yet.

  • Hi ,

     

    Yes, you can execute  command on remote machine using power shell. I used to do this instead of login into individual server . Also you can write script in python or Perl , shell any language for administrating Linux machines  that your comfortable.

    For know your OS . If you have any naming convention for your environment , you can use this in your script to identify OS type. Example , All windows servers are started with W letter in my environment  or any string combination you can use as per your environment.

    For window remote execution of command ,you can use below.

    Open power shell as administrator access ,execute below.

    Invoke-Command -ComputerName  (server name) -ScriptBlock{Any command e.g ovc} 

     

  • Verified Answer

    /Base [1.14.0]/Library/Operations/Operating Systems/Windows/Operating System Detector

    This one is not working on our Linux machines. Error is: " Algorithm negotiation fail". i guess it is problem with encryption algorithm.

    i am using now this one. it is working with Windows (port 5985 - Remote Power shell) and Linux server (port 22 - SSH):

    /Base [1.14.0]/Library/Operations/Operating Systems/Cross Platform/Operating System Detector