NewOrderFac33
Well-known Member
- Joined
- Sep 26, 2011
- Messages
- 1,283
- Office Version
- 2016
- 2010
- Platform
- Windows
Good afternoon, RoryA kindly provided me with the following function to determine the IP address of a remote host, but whilst it works happily for Windows hosts, it doesn't work for Linux ones.
Does anyone have an equivalent for Linux hosts, please - please note, it needs to work in Win10/Office 2016 64 bit, please.
Thanks in advance and have a nice weekend, all!
Pete
Code:
Function fWMIGetIPAddress(strComputer As String) As String
Dim objWMIService, colItems, objItem
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objItem In colItems
fWMIGetIPAddress = objItem.IPAddress(0)
Exit For
Next objItem
End Function
Thanks in advance and have a nice weekend, all!
Pete