I've been looking around for a bit now, and I have come up with this mix of script...it does pretty much what I need but it does not look pretty on the message box when it comes to the IP address...currently they are displayed together with no space example (wiredIPwirelessIP). Ideally what I would like is to have the message box say Username: user Computer Name: Computer1 Wired IP: X.X.X.X Wireless IP: X.X.X.X
Any help would be appreciated.
Here is what I have so far
On Error Resume Next
Dim WSH
Dim strComputerName, FinalIP
Set WSH = WSCript.CreateObject("WScript.Shell")
Set WshNtwk = WScript.CreateObject("WScript.Network")
strMsg = ""
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set IPAdapterSet = objWMIService.ExecQuery("Select AdapterType, NetConnectionID, MACAddress from Win32_NetworkAdapter")
For Each IPConfig in IPAdapterSet
Set IPConfigSet = objWMIService.ExecQuery("Select IPEnabled, Description, Caption, IPAddress, MACAddress from Win32_NetworkAdapterConfiguration where IPEnabled='True' AND MACAddress = '" & IPConfig.MACAddress & "'")
For Each IPConf in IPConfigSet
''strMsg = strMsg
If Not IsNull(IPConf.IPAddress) Then
For i = LBound(IPConf.IPAddress) to UBound(IPConf.IPAddress)
If Not ((Instr(IPConf.IPAddress(i), ":") > 0) or (Instr(IPConf.IPAddress(i), "none") > 0)) Then
if i=0 then
strMsg = strMsg & IPConf.IPAddress(i)
else
strMsg = strMsg & ", " & IPConf.IPAddress(i)
end if
End If
Next
End If
next
Next
''WScript.Echo strMsg
Dim infroStr
infoStr = "Please provide the following information to the IT Technician." & vbCRLF & vbCRLF & _
" Username :" & vbTab & WshNtwk.UserName & vbCRLF & _
" Computer Name :" & vbTab & Ucase(WshNtwk.ComputerName) & vbCRLF & _
" IP Address(es) :" & vbTab & strMsg
'"Domain:" & WshNtwk.UserDomain
' Display the IP address and computer name in user-friendly message box
MsgBox infoStr, 64, "Some Title"
'"Computer Name:" & vbTab & Ucase(WshNtwk.ComputerName) & vbCrLf & "IP Address:" & vbTab & FinalIP, vbOkOnly , "SCCCMHA PC Information"
On Error Goto 0
WScript.Quit