Highlighted
Trusted Contributor.
Trusted Contributor.
148 views

Windows or Linux probe or operation or flow

Jump to solution

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.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Trusted Contributor.
Trusted Contributor.

/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

View solution in original post

0 Likes
3 Replies
Highlighted
Trusted Contributor.
Trusted Contributor.

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.

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

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} 

 

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

/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

View solution in original post

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.