I am quessing, since you mention services.msc, we are talking about Windows here. The only way to do what you want is by calling native code. There are third party tools to manage remote services but I think (someone may correct me) the only tool supplied with Windows is RDP. If your target machines are running terminal services you may be able to connect and query the registry and task manager. But before you even attempt to do this through Java, you'll need to find out if it is event possible, so I'd start to look at the documentation.
(By the way, your previous topic is not closed, it has been moved, since it was not an advanced question. )
The Windows command net start lists the set of started services in WIndows. If you create a bat file in the server machine that calls this command, then you can use it with a java.lang.ProcessBuilder to get its output.
The bat file listservices.bat would say:
And I could use it this way:
You may need to improve the algorithm to remove blank lines and messages displayed in the command line.
Once this is working you could create a very simple Java socket that returns this information.
You could also use another Windows commands, like tasklist which lists all the programs currenly running.
Could that be helpful? [ December 12, 2006: Message edited by: Edwin Dalorzo ]
Originally posted by Rahul Bhattacharjee: How about remote mornitoring of services using JMX.
[ December 12, 2006: Message edited by: Rahul Bhattacharjee ]
Not sure I follow how adding JMX helps - perhaps I missunderstand, but will JMX not just give you a route to manage whatever software you write to monitor the Windows services? i.e. its just a layer on top of whatever solution you write for this probelm, it doesn't fix the problem itself.
Edwin Dalorzo's solution may well work. And simple is often the best. I'm not sure though how you would get the batchfile to run remotely. As far as I am aware you can only do that sort of thing with a WSF (and that presumes all remote machines are XP or higher). [ December 12, 2006: Message edited by: Paul Sturrock ]