title: Powershell COM object Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED)
body: <p>I am trying to use powershell to script some tasks within internet explorer.  This involves downloading a file from a website after logging in to the site.  I have one working test script, but the same code for the actual site gives me this error:</p>
  
  <p>The '=' operator failed: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED)).
  At U:\PowershellScriptProjectSFTP\test.ps1:71 char:22
  +         $controlRef = &lt;&lt;&lt;&lt;  $browserDoc.getElementByID($controlID)
      + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
      + FullyQualifiedErrorId : OperatorFailed</p>
  
  <pre><code>$browserDoc
  $ie = new-object -com "InternetExplorer.Application"
  $ie.navigate("about:blank")
  $ie.visible = $true
  [System.Threading.Thread]::Sleep(2000)
  $ie.navigate($URL)
  #get controls
  write-host "Getting Document"
  $browserDoc=$ie.Document    
  write-host "Getting Email component"
  $email = $browserDoc.getElementById("MainContent_userEmail")
  write-host "Getting Password component"
  $pass = $browserDoc.getElementById("MainContent_userPassword")
  write-host "Getting Button component"
  $login = $browserDoc.getElementById("MainContent_submitButton") 
  </code></pre>
  
  <p>The actual error is occuring elsewhere in the code, which I have left out because it is doing the same thing as up here, but during the loop to ensure the page is done loading.  This code has worked from the same machine on a different site, but both were .net aspx 2.0 sites.</p>
  
  <p>Basically, once the internet explorer navigates to the specified url, powershell loses the ability to communicate with the object, and this error is followed by several InvokeMethodOnNull and PropertyNotFound errors (these I understand, they are a result of referencing $ie, which has become a null object, the entire problem I am trying to diagnose).  I am running Windows 7.  Microsoft claims to have a fix for this, but only for XP and Server 03 and 08.</p>
  
  <p>Really, just any explaination for what causes this behavior is all I am looking for.  As I said, this same code pointed to some websites works perfectly, and at others fails everytime.    </p>