Loading
Hi Geeks,
I am working on a Script where I should be able to launch all the web applications in the browser to open in tabs.
I have worked out with the following script and was able to come upto an extent where I am able to launch the Internet Explorer.But ....only 1 web app opens up and throws an error message :
Exception calling "Navigate" with "1" argument(s): "The interface is unknown. (Exception from HRESULT: 0x800706B5)"
Below is my script
Add-PSSnapin Microsoft.sharepoint.powershell -ErrorAction SilentlyContinue
$webApps = Get-SpWebapplicationCan anyone help me with the logic to open all the web apps in the browser?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Karthik Muthu KaruppanPosted Apr 14, 2015, 5:27 PM
I could see that you have missed the looping. For this reason only the last web app in the list opens in IE,
$webApps = Get-SpWebapplication
foreach($webapp in $WebApps){
$URL = $webapp.URL
$ie = New-Object -ComObject InternetExplorer.Application
$ie.Navigate($URL)
}
The above piece of code must open all your sites in new browser.
Aravinda RaoPosted Mar 19, 2015, 5:28 AM
Thanks for a quick response.
The URL you mentioned has $oIE.navigate2("About:blank") which is directing to navigate to the "About:blank" page and it works fine because you are specifying the URL to be directed to.
I am looking for a script which should get the URLs from Get-SPWebApplication and and then open all of them in tabs at a time.
My script gives all the URLs in the output however it opens only 1 URL in the browser. I need to know what logic I should write here under for each loop so that it reads all the urls and opens in browser.
Hope I made it clear
$webApps = Get-SpWebapplication
foreach($webapp in $WebApps){
$URL = $webapp.URL
}
Bhushan GawalePosted Mar 19, 2015, 5:14 AM