title: Windows, Start service System.InvalidOperationException: Cannot start service on computer '.' Access in Denied(Running as Admin)
body: <p>I am trying to start service using the below code. This works fine for 99% machines but i get this issue on user machines. Any help to be able to reproduce this error or why this issue happens.</p>
  
  <pre><code>            ServiceController sc = new ServiceController(name);
  
              if (sc.Status == ServiceControllerStatus.Running ||
                      sc.Status == ServiceControllerStatus.StartPending)
              {
                  sc.WaitForStatus(ServiceControllerStatus.Running);
                  Logger.Info("Service already running");
                  return true;
              }
              sc.Start();
  </code></pre>
  
  <p>Error I receive is </p>
  
  <blockquote>
    <p>System.InvalidOperationException: Cannot start service on computer
    '.'. ---> System.ComponentModel.Win32Exception: Access is denied</p>
  </blockquote>
  
  <p>I am running with Administrator privileges</p>
  
  <p>When creating the service I also run sc sdset command to make service start stop by non admin processes.</p>