Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim strQuery, strMac, url, args, status, dateStamp
- Set args = WScript.Arguments
- If args.Count < 1 Then
- Wscript.Echo "Can't send empty status"
- Wscript.Quit
- End If
- status = args.Item(0)
- msg = ""
- If args.Count > 1 Then
- For i = 1 to args.Count - 1
- msg = msg & " " & args.Item(i)
- Next
- msg = LTrim(msg)
- End If
- url_status_internal="__URL_STATUS_INTERNAL__"
- url_status_external="__URL_STATUS_EXTERNAL__"
- strMAC = ""
- ' We're interested in MAC addresses of physical adapters only
- strQuery = "SELECT * FROM Win32_NetworkAdapter WHERE NetConnectionID > ''"
- Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
- Set colItems = objWMIService.ExecQuery( strQuery, "WQL", 48 )
- For Each objItem In colItems
- If InStr( strMAC, objItem.MACAddress ) = 0 Then
- strMAC = objItem.MACAddress
- 'We only want the first MAC found
- Exit For
- End If
- Next
- If status = "FIRSTBOOT" OR status = "ERROR_INSTALL_SOFTWARES" Then
- url = url_status_external
- Else
- url = url_status_internal
- End If
- If msg = "" Then
- urlString = url & "?mac=" & strMAC & "&status=" & status
- Else
- urlString = url & "?mac=" & strMAC & "&status=" & status & "&msg=" & msg
- End If
- Dim httpObject
- Set httpObject = CreateObject("MSXML2.XMLHTTP")
- httpObject.open "GET", urlString, False
- httpObject.send
Add Comment
Please, Sign In to add comment