Shows to what Hal can do as far as communication .
It demonstrates what can be done with vb. and DOM
I use a variant of this my self. Enjoy, and feel free to chop up to ur needs.
you can always reach me here with other Hal hard core users.
http://vaughnlive.tv/mrelectricHINT:Hal use's this to communicate and post to a website
'
' Hardware Inventory Script
'
' Script: WinHWInv.vbs
'
' Purpose: Gather hardware information for migration plan to Windows 7
'
'Create necessary objects
set shellObj = WScript.CreateObject("WScript.Shell")
set netObj = CreateObject("WScript.Network")
set fsObj = CreateObject("Scripting.FileSystemObject")
'******************************************************************************
'Global Settings
' contains variables, constants, or other settings that are used throughout
' the script
'******************************************************************************
set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
'******************************************************************************
'Query data via WMI
'******************************************************************************
set SYSTEMINFO = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
set BIOSINFO = objWMIService.ExecQuery("Select * from Win32_BIOS")
set PROCINFO = objWMIService.ExecQuery("Select NumberOfCores, NumberOfLogicalProcessors, Architecture, MaxClockSpeed, Family from Win32_Processor")
set DISKINFO = objWMIService.ExecQuery("Select Size from Win32_DiskDrive")
set OSINFO = objWMIService.ExecQuery("Select Caption, InstallDate, ServicePackMajorVersion from Win32_OperatingSystem")
set IPINFO = objWMIService.ExecQuery("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
'******************************************************************************
'Place queried data into variables
'******************************************************************************
for each record in SYSTEMINFO
sysName = record.Name
sysDomMember = record.PartOfDomain
sysUser = record.UserName
sysTotalMem = record.TotalPhysicalMemory / 1048576 'Divide by 1048576 to get total MB of RAM
next
for each record in BIOSINFO
sysSerial = record.SerialNumber
next
for each record in PROCINFO
procNumCores = record.NumberOfCores
procLogProc = record.NumberOfLogicalProcessors
procArch = record.Architecture
procSpeed = record.MaxClockSpeed
procFamily = record.Family
next
for each record in DISKINFO
diskSize = record.Size / 1073741824 'Divide by 1073741824 to get GB for disk size
next
for each record in OSINFO
osVersion = record.Caption
osServicePack = record.ServicePackMajorVersion
osInstall = record.InstallDate
next
ipAddress = ""
for each record in IPINFO
if not IsNull(record.IPAddress) then
for i = LBound(record.IPAddress) to UBound(record.IPAddress)
ipAddress = ipAddress & record.IPAddress(i)
next
end if
next
'******************************************************************************
if InStr(osVersion,"Microsoft Windows XP") then
'wscript.echo "Match"
pscommand = "C:\admintools\get-antivirus-xp.ps1"
else
'wscript.echo "No Match"
pscommand = "C:\admintools\get-antivirus.ps1"
end if
cmd = "powershell.exe -ExecutionPolicy Bypass " & pscommand
Set shell = CreateObject("WScript.Shell")
Set executor = shell.Exec(cmd)
executor.StdIn.Close
antivirus = executor.StdOut.ReadLine
status = executor.StdOut.ReadLine
'wscript.echo antivirus & " = " & status
if status = "262144" then
status = "Up to date and Disabled"
ElseIf status = "262160" then
status = "Out of date and Disabled"
ElseIf status = "266240" then
status = "Up to date and Enabled"
ElseIf status = "266256" then
status = "Out of date and Enabled"
ElseIf status = "393216" then
status = "Up to date and Disabled"
ElseIf status = "393232" then
status = "Out of date and Disabled"
ElseIf status = "393488" then
status = "Out of date and Disabled"
ElseIf status = "397312" then
status = "Up to date and Enabled"
ElseIf status = "397328" then
status = "Out of date and Enabled"
ElseIf status = "397584" then
status = "Out of date and Enabled"
Else
status = "Unknown"
End If
avStatus = status
avName = antivirus
'wscript.echo antivirus & " = " & status
'wscript.echo Escape(avName)
'******************************************************************************
'Submit data to database
'******************************************************************************
' URLPath for capturing data
http://www.cyberjedi.php' URLVars=sysName=" & sysName & ";sysDomMember=" & sysDomMember & ";sysUser=" & sysUser & ";sysTotalMem=" & sysTotalMem & ";procNumCores=" & procNumCores & ";procLogProc=" &
procLogProc & ";procArch=" & procArch & ";procSpeed=" & procSpeed & ";procFamily=" & procFamily & ";diskSize=" & diskSize & ";osVersion=" & osVersion & ";osServicePack=" &
osServicePack & ";osInstall=" & osInstall & ";ipAddress=" & ipAddress &
URLPath = "
http://www.cyberjedi.php"
URLVars = "sysName=" & sysName & "&sysDomMember=" & sysDomMember & "&sysUser=" & sysUser & "&sysSerial=" & sysSerial & "&sysTotalMem=" & sysTotalMem & "&procNumCores=" &
procNumCores & "&procLogProc=" & procLogProc & "&procArch=" & procArch & "&procSpeed=" & procSpeed & "&procFamily=" & procFamily & "&diskSize=" & diskSize & "&osVersion=" &
osVersion & "&osServicePack=" & osServicePack & "&osInstall=" & osInstall & "&ipAddress=" & ipAddress & "&avName=" & avName & "&avStatus=" & avStatus
'wscript.echo URLPath & "?" & URLVars
Set web = Nothing
Set web = CreateObject("WinHttp.WinHttpRequest.5.1")
If web Is Nothing Then Set web = CreateObject("WinHttp.WinHttpRequest")
If web Is Nothing Then Set web = CreateObject("MSXML2.ServerXMLHTTP")
If web Is Nothing Then Set web = CreateObject("Microsoft.XMLHTTP")
web.Open "GET", URLPath & "?" & URLVars, False
web.Send
'MsgBox "The specs for this PC have been submitted. Thank you for your help."
WScript.Quit