I'm trying to write a script in powershell that i can use to get the HTML from a website after a query has been run.
On my own machine i can run the below which works with no issues, but when i try to run it on a Server 2008 machine i get no output from the Document.Body.InnerHTML command, all the Document.GetElementById parts work with no issues.
$ie = New-Object -com InternetExplorer.Application
$ie.silent = $true
$ie.navigate2("http://www.mxtoolbox.com/")
while($ie.busy) {start-sleep 1}
$ie.Document.getElementById("ctl00_ContentPlaceHolder1_txtToolInput").Value = "mx:domain.co.uk"
$ie.Document.getElementById("ctl00_ContentPlaceHolder1_btnAction").Click()
Start-Sleep -Seconds 10
$ie.Document.body.innerHTML | Out-File "C:\NETESP\MXRecords\MXRecordsHTML.txt" -Encoding ASCII
$ie.Quit()
Is there something i need to have installed on a server 2008 box to make this return a value?
Thanks in Advance
$ie.Visible = $truein place of$ie.silent = $truebut this made no difference.