I have a three servers and I want windows servers list these servers. for one server I writing this code and I listing Windows server names and status. ServiceController.GetServices();
How can I do with multiple servers?
Asked
Active
Viewed 63 times
0

SurvivalMachine
- 7,946
- 15
- 57
- 87

Mehmet Erdanışman
- 19
- 1
-
Just call GetServices() separately for each server, then merge the arrays. – Harry Johnston Oct 01 '16 at 21:52
-
@HarryJohnston Firstly thank you your replay. But I don't know how can I do. How should I proceed ? Do I need write application for each server ? for exapmle; for three server, 3 sub application and one main application ? – Mehmet Erdanışman Oct 03 '16 at 08:55
-
You don't need multiple applications. To list the services on a remote server, you can use the GetServices(String) variant, https://msdn.microsoft.com/en-us/library/s21fd6th(v=vs.110).aspx – Harry Johnston Oct 03 '16 at 20:06