title: WMI call fails from .NET code, but not C++
body: <p>From C# (.NET 4.0), we're making a WMI call like this:</p>
  
  <pre><code>var connectOptions = new ConnectionOptions
  {
      Authority = "ntlmdomain:" + paramValues.Domain,
      Username = paramValues.UserName,
      Password = paramValues.Password
  };
  
  var scopeString = @"\\" + paramValues.Server + @"\root\cimv2";
  var scope = new ManagementScope(scopeString, connectOptions);
  scope.Connect();
  
  var queryString = String.Format("SELECT * FROM Win32_NTLogEvent WHERE LogFile = 'Security' AND TimeGenerated &gt; '{0:yyyyMMddHHmm00.000000+0000}'";,
                  paramValues.StartTime);
  
  var query = new ObjectQuery(queryString);
  var searcher = new ManagementObjectSearcher(scope, query);
  
  var queryCollection = searcher.Get();
  </code></pre>
  
  <p>This works fine, with the exception of a failure against only one of our servers. In that case, the <code>searcher.Get()</code> call hangs. Looking at the network traffic through Wireshark reveals that the Event Log entries are being correctly returned, but at some point the remote server simply terminates the TCP connection.</p>
  
  <p>I found a WMI Tester utility online (<a href="http://www.paessler.com/tools/wmitester" rel="nofollow">http://www.paessler.com/tools/wmitester</a>) that appears not to be written against the .NET framework (using DCOM). I can supply the same credentials and the same WMI query using that tool and get back the expected results.</p>
  
  <p>Am I right to suspect that something is different between the .NET code and the DCOM call, or am I chasing the wrong thing? So far this is the only difference between the working and non-working code that I can find.</p>