I am trying to get xml data from the api via vbscript on Windows 2000.
My simple VB script :
URL = "http://prtgserver1/api/table.xml?content=sensors&columns=sensor&username=xx&password=xx"
' {note : xx replaced with a real username/password}
Set WshShell = WScript.CreateObject("WScript.Shell")
Set http = CreateObject("Microsoft.XmlHttp")
'http.setoption 2,13056
http.open "GET", URL, FALSE
http.send ""
WScript.Echo http.responseText
set WshShell = nothing
set http = nothing
This returns the error: 0x800C000E
In researching this error, it appears to be related to the security certificate not being trusted. Any idea how to work around this in vbscript?
In case this helps someone else in the future, I managed to find something that works:
URL = "http://prtgserver1/api/table.xml?content=sensors&columns=sensor&username=xx&password=xx" ' {note : xx replaced with a real username/password} Set WshShell = WScript.CreateObject("WScript.Shell") Set http = CreateObject("msxml2.serverXmlHttp") http.open "GET", URL, FALSE http.setoption 2,13056 http.send "" WScript.Echo http.responseText set WshShell = nothing set http = nothing 13056 = SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORSPS : I'm not a strong VB coder. Your mileage may vary. :)
Nov, 2010 - Permalink