PowerShell - InternetExplorer: 0x80010108 (RPC_E_DISCONNECTED)

13

I want to automate the InternetExplorer with PowerShell to open a site in our intranet (trusted sites | protected mode: off)

When I´m executing my code the IE open the intranet site but the reference to the $ie object is lost.

Error: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))

How can I fix this? (Run IE as admin is not a option)

$ie = New-Object -ComObject InternetExplorer.Application
$ie.visible = $true
$ie.Navigate($url)
$ie

My workaround, but not so good:

& "C:\Program Files\Internet Explorer\iexplore.exe" $urls
Start-Sleep 5
$shell = New-Object -com Shell.Application
$ie = @($shell.Application.Windows())| Where-Object { $_.LocationUrl -like "*$urls*" }
$ie.Navigate($url2)
internet-explorer
powershell
asked on Stack Overflow Jul 17, 2012 by LaPhi • edited Aug 24, 2012 by LaPhi

1 Answer

4

Try running PowerShell as an administrator.

answered on Stack Overflow Jan 31, 2013 by Christopher Douglas • edited Mar 1, 2019 by Undo

User contributions licensed under CC BY-SA 3.0