C# .NET - Windows Service + Other Privileges Issue

Asked By BALAJI KRISHNAN on 29-Dec-04 04:30 AM
I created a windows service which checks the status of the another service which is in the remote machine.

When I run the service in my machine it is working fine and I can get the status of another service which is in remote machine.

But when I install the serice in another machine, It says that

"Cannot open Service Control Manager in this Computer This operation requires other privileges"

Hers is my code.

ServiceController[] services;
services = ServiceController.GetServices(machinename);
for(int i = 0;i< services.Length;i++)
{	
	
if (services[i].ServiceName == servicename)
{
ServiceController sc = new ServiceController(services[i].ServiceName,remotemachinename); 						if(sc.Status == ServiceControllerStatus.Stopped)
{
}
}

Looking for the response.

What could be the problem

Balaji

				{

My best guess - Asked By Scott Grosch on 31-Dec-04 04:36 PM

would be that the account you used on the current machine is not an administrator on the remote machine.
naman replied to BALAJI KRISHNAN on 19-Sep-11 05:32 AM

Hi balaji,

i'm getting error in

ServiceController[] services = ServiceController.GetServices("devssv63");


please suggets.asking for other privileges issue