title: Get-WMIObject fails to enumerate Win32_LogicalDiskToPartiion in elevated powershell
body: <p>I have a really simple Powershell query:</p>
  
  <pre><code>Get-WmiObject -query 'ASSOCIATORS OF {Win32_LogicalDisk.DeviceID="C:"} WHERE AssocClass = Win32_LogicalDiskToPartition'
  </code></pre>
  
  <p>On a Windows 7 (64-bit) machine, running this in a Powershell correctly enumerates a single management object. However if I run the same query in an elevated Powershell I get a long pause and then no results.</p>
  
  <p>I find a similar problem when trying to execute the WMI query in code (which is what I am actually trying to do) - when my program runs without elevation the code works, when it runs with elevation no results are returned. This is the simplest version of my code that shows this problem:</p>
  
  <pre><code>static void Main(string[] args)
  {
      var query = "ASSOCIATORS OF {Win32_LogicalDisk.DeviceID=\"C:\"} WHERE AssocClass = Win32_LogicalDiskToPartition";
      var searcher = new ManagementObjectSearcher(query);
      foreach (var o in searcher.Get())
      {
          Console.WriteLine(o);
      }
      Console.WriteLine("DONE");
      Console.ReadLine();
  }
  </code></pre>
  
  <p>Why does this happen ? More importantly is there anyway I can ensure that this query will execute correctly when run elevated - as the final program will need to run elevated for other reasons.</p>