Check the status of a service in remote computer

HI,
How do I check the status of a service in a remote computer.
For example, I have created service status activity.

In the ServiceName parameter, I entered “\server1\W3SVC” as the name of the service I want to check the status but I am getting “cannot find computer error message”.

Note: Server1 is just a placement for my actual server name.

Hi,

You can use a simple assign activity, before that import namespace “System.ServiceProcesses”

As per the above image, use a variable as “output” and variable type as “Service controller” and initialize it as shown above and use the method “Status” with the above variable.

Store the output of the above assign statement into a variable of type “ServiceControllerStatus” and use and writeline to print the output.

Hi anil5
Is the value for the servicename attribute correct?
Is that how a remote computer name should be entered for the Servicename attribute?

Hi,

The problem is the service name which we provide always looks for services in local computer not on the remote desktop.

So is there any particular requirement that you want to check for particular service, if yes please explain more about that.

Hi anil5,

Yes I want to check for a specific service on a remote computer. Is that possible?

Hi,

Its not possible to get the service status on a remote computer, as all .Net methods and the activities are about to local machine.