title: C# check windows Service status
body: <p>I'm using the following code to check my windows service status:</p>
  
  <pre><code> ServiceController sc = new ServiceController("service name", "service location");
  </code></pre>
  
  <p>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.</p>
  
  <p>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. </p>
  
  <p>my question is: what "type of permission" to be given to what "user" or "machine name"?  please help.</p>