title: Windows service started with ServiceController throws "RPC Server not available" when performing WMI connection
body: <p>I have a Windows service being installed with my installer, and then started with the use of <a href="http://msdn.microsoft.com/en-us/library/7fs05y7h.aspx" rel="nofollow">ServiceController</a>:</p>
  
  <pre><code>public static int StartService(string serviceName, int timeoutMilliseconds)
  {
      ServiceController service = new ServiceController(serviceName);
      try
      {
          TimeSpan timeout = TimeSpan.FromMilliseconds(timeoutMilliseconds);
  
          service.Start();
          service.WaitForStatus(ServiceControllerStatus.Running, timeout);
  
          service.Close();
  
          return 0;
       }
       catch
       {
          return 1;
       }
  }
  </code></pre>
  
  <p>The service seems to start just fine, but when the service tries to perform WMI calls to remote computers, it throws an exception;</p>
  
  <pre><code>The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
  </code></pre>
  
  <p>I've tried connecting with WBEMTest from the machine the service is running on, to the same machine the service tries to connect to, and it works fine.</p>
  
  <p>Also, if I start the service manually from Services.msc, it works perfectly. What am I missing with ServiceController?</p>