systemmanagement

how to access romote windows service with Related ObjectQuery

倾然丶 夕夏残阳落幕 提交于 2019-12-22 17:39:55
问题 I want to control (start and stop) a windows service which is in the remote machine. I can connect that machine but I can't access to windows service. Here is my code. Can you help me? ConnectionOptions oConn = new ConnectionOptions(); oConn.Username = "****"; oConn.Password = "****"; ManagementScope managementScope = new ManagementScope(@"\\***.***.***.***\root\CIMV2", oConn); managementScope.Connect(); RelatedObjectQuery roq = new RelatedObjectQuery("Win32_Service.Name='KanAktarim'");

Which tool / technology: System management for databases and dependent services

拈花ヽ惹草 提交于 2019-12-07 12:27:11
问题 A follow-up on this system management question: Since I probably will not get much feedback on serverfault I'll give it a try here. My main concern is to reflect the dependencies between the databases, services ans tasks/jobs I'll have to manage. Besides considering Powershell, I even thought about using MSBuild because it would allow for modeling dependencies and reuse configuration targets. In other words: What technology should I use to develop a flexible solution that will allow me to

how to access romote windows service with Related ObjectQuery

岁酱吖の 提交于 2019-12-06 09:27:53
I want to control (start and stop) a windows service which is in the remote machine. I can connect that machine but I can't access to windows service. Here is my code. Can you help me? ConnectionOptions oConn = new ConnectionOptions(); oConn.Username = "****"; oConn.Password = "****"; ManagementScope managementScope = new ManagementScope(@"\\***.***.***.***\root\CIMV2", oConn); managementScope.Connect(); RelatedObjectQuery roq = new RelatedObjectQuery("Win32_Service.Name='KanAktarim'"); ManagementObjectSearcher moSearcher = new ManagementObjectSearcher(managementScope, roq);