Visual Basic Script - Cisco C880 M5 Configuration Manual

Hide thumbs Also See for C880 M5:
Table of Contents

Advertisement

6.2.2

Visual Basic script

Scripting is also possible with Visual Basic. The following VB script retrieves the
report.xml from the iRMC and saves it into a local file, also named report.xml:
IP_ADRESSE = "192.168.1.100"
USER_NAME = "admin"
PASSWORD = "admin"
FILE_NAME = ".\\report.xml"
ADDONS = "/report.xml"
' ------------------------------------------------------------------------------------------------
On Error Resume Next
Function SaveBinaryData(FileName, ByteArray)
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2
Dim BinaryStream
Set BinaryStream = CreateObject("ADODB.Stream")
BinaryStream.Type = adTypeBinary
BinaryStream.Open
BinaryStream.Write ByteArray
BinaryStream.SaveToFile FileName, adSaveCreateOverWrite
WScript.Echo "Antwort:" & BinaryStream.Read
End Function
Set xmlHttp = CreateObject("Msxml2.XMLHTTP")
xmlHttp.Open "GET", "http://" & IP_ADRESSE & ADDONS, False, USER_NAME, PASSWORD
xmlHttp.Send
If InStr(xmlHttp.GetResponseHeader("Content-Type"), "xml") > 0 Then
SaveBinaryData FILE_NAME,xmlHttp.ResponseBody
Else
Wscript.Echo ADDONS &" not found on " &IP_ADRESSE
End If
Cisco C880 M5 Configuration Guide
6.2 iRMC system report
78

Advertisement

Table of Contents
loading

Table of Contents