I'm using the following code to check my windows service status:
ServiceController sc = new ServiceController("service name", "service location");
in the service location H'm putting the server name which my service reside on. on my test environment, I have the service and portal (IIS) where I check my service on the same server and it works fine, but on my production environment, The service is on a different server than my portal IIS.
and my code is unable to check the status. I'm sure it is a permission issue, but I tried so many this to make it work but no use.
my question is: what "type of permission" to be given to what "user" or "machine name"? please help.