
Set objComputer = GetObject(adoRecordset.Fields(0). Set adoRecordset = adoConnection.Execute(" (&(objectCategory=Computer)(name=" & objNetwork.Computername & ")) adspath subtree") Set adoConnection = CreateObject("ADODB.Connection")ĪdoConnection.Open "Active Directory Provider" Once traffic is routed you are unable to get the MAC address as it is stripped from the packet once it crosses the boundary of a router/元 device. ARP is a broadcast protocol and is therefore only available on a LAN. StrMacAddresses = strMacAddresses & Trim(objNetworkAdapterConfiguration.MACAddress) Getting a MAC address requires the ability to get broadcast traffic. If Not colNetworkAdapterConfiguration Is Nothing Thenįor Each objNetworkAdapterConfiguration in colNetworkAdapterConfiguration Set colNetworkAdapterConfiguration = objWMIService.ExecQuery("Select * From Win32_NetworkAdapter Where AdapterType = 'Ethernet 802.3' OR AdapterType = 'Wireless'") Set objWMIService = GetObject("Winmgmts:\\" & strComputer & "\root\cimv2")



Set objNetwork = WScript.CreateObject("WScript.Network") Set objRootDSE = GetObject("LDAP://RootDSE") This is an example based on a script I use (its in VBScript): Option Explicitĭim objRootDSE, objNetwork, objWMIService, objComputerĭim colNetworkAdapterConfiguration, objNetworkAdapterConfiguration In fact, it could even lead them to you thanks to geolocation data, although to pinpoint your actual location it would probably be necessary to demand the information from your ISP – with a search warrant.As the comments have said, that information is not held in Active Directory.Ĭonsider using a computer start-up script to populate a field in AD with the mac address.Īlso consider that many devices can have multiple mac addresses, some laptops may have 3 even. It’s an unlikely scenario, but if someone had your IP address it is possible that they could hack you, so be wary about telling it to anyone. You might need to know your IP address when setting up certain types of software,

Why would anyone need to know your IP address If someone refers to your IP address they probably mean the external one, but we’ll show how to find out both in this article. This will always be in IPv4 form (four numbers separated by dots) and will nearly always be .X, with the Xs varying from device to device. A group of offline computers linked on a private network would use internal IP addresses to talk to each other, and your Wi-Fi router will use internal IP addresses to speak to the various devices that connect to it.
