How to get a list of active IP addresses, MAC addresses and NetBIOS names on a local network?

How to get a list of active IP addresses, MAC addresses and NetBIOS names on the local network?

I want to get the NetBIOS name, IP and MAC addresses for each host on the local network, preferably you do not need to go through each one PC and pay attention to the material.

How to do it with Windows Script Host / PowerShell / what?

+4
source share
5 answers

As Darren Thomas said, use nmap.

nmap -sP 192.168.1.1/24 

to scan the network 192.168.1. *

  nmap -O 192.168.1.1/24 

to get the user's operating system. Read the manpage for more information.

  man nmap 

considers

+9
source
 arp -a 

This is all the current computer on the network knows about.

(I put this as the second option, since nmap is not installed everywhere).

+6
source

If you use DHCP, then the server will provide you with a list of all this information.

This website has a good tutorial on using powershell to get online information http://www.powershellpro.com/powershell-tutorial-introduction/powershell-scripting-with-wmi/

If you want a quick list of computer names, you can use "net view". Also look at nbmac, although I'm not sure about its performance under XP. Another option would be to use nbtstat -a (after you used the network view to display workstations)

+2
source

In PowerShell, you can do something like:

$ computers = "server1", "server2", "server3"

Get-WmiObject Win32_NetworkAdapterConfiguration -computer $ computers -filter "IPEnabled = 'true'" | select __Server, IPAddress, MACAddress

+1
source

In PowerShell:

 function Explore-Net($subnet, [int[]]$range){ $range | % { test-connection "$subnet.$_" -count 1 -erroraction silentlycontinue} | select -Property address | % {[net.dns]::gethostbyaddress($_.address)} } 

Example:

 Explore-Net 192.168.2 @(3..10) 
0
source

Source: https://habr.com/ru/post/1276853/


All Articles