title: Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
body: <p>When I run</p>
  
  <pre><code>Get-WmiObject win32_SystemEnclosure -Computer hostname | select serialnumber
  </code></pre>
  
  <p>it works for both local and remote hosts.</p>
  
  <p>When I do this for a list of hosts using</p>
  
  <pre><code>ForEach ($_ in gc u:\pub\list.txt) {
      Get-WmiObject win32_SystemEnclosure -Computer $_ | select serialnumber | format-table -auto @{Label="Hostname"; Expression={$_}}, @{Label="Service Tag"; Expression={$_.serialnumber}}
  }
  </code></pre>
  
  <p>it returns</p>
  
  <blockquote>
    <p>Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)</p>
  </blockquote>