0

I am using ServiceController.GetServices() succcessfully on a local machine to get a list of services. I should be able to do the same for another PC with the supplied machineName parameter.

The two PCs are on the same LAN, same network mask, same workgroup. I am the local admin on both with an identical password. My application is running with elevated permissions and yet I get InvalidOperationException with Cannot open Service Control Manager on computer 'XXX'. This operation might require other privileges.

What else do I need to do to make this work? I have seen some references about "impersonation" in order for this to work but I am not sure what is to impersonate if users are matched on two PCs. I can access network shares w/o having to enter any credentials.

I would hate to have to resort to WMI for solution as there is a clean C# way for this.

4

0 回答 0