This is more of a general question, but I am trying to see if anyone would know a way to download the inventory as CSV. I am trying to automate this and was thinking powershell
$username = "user"
$password = "pass"
$ie = New-Object -com InternetExplorer.Application
$ie.visible=$true
$ie.navigate("url.lsps.org")
while($ie.ReadyState -ne 4) {start-sleep -m 100}
$ie.document.getElementById("username").value= "$username"
$ie.document.getElementById("password").value = "$password"
Start-Sleep -m 100
$ie.document.getElementById("login-form-submit").click()
Start-Sleep -s 4
$ie.Navigate('http://fogserver.org/fog/management/?node=report&sub=inventory')
Start-Sleep -s 4
$ie.Navigate('http://fogserver.org/fog/management/export.php?type=csv')
I can get this work in IE 11 but then I get a popup asking to save and I can’t figure out a way to stop this and my google-fu didn’t provide much luck. I can get all the elements and tags needed via this below snippet, but I am not sure how to input the data:
$inv = Invoke-WebRequest 'fogserver.org'
$inv.ParsedHtml.getElementById("username")
$inv.ParsedHtml.getElementById("password").value= "password"
$inv.ParsedHtml.getElementById("login-form-submit").click()
Any help is greatly appreciated.
Thanks,