• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 476
  • Last Modified:

Get MAC address of all machines in the network

Hi,

I want to get the mac address of all machines in the network.

Machinename    Mac address

Is there a way to do this.

Regards
Sharath
0
bsharath
Asked:
bsharath
  • 3
1 Solution
 
Farhan KaziSystems EngineerCommented:
The quickest way to scan your network through Angry IP Scanner.

Use  "Angry IP Scanner" to scan.
Download it from:
http://www.angryziber.com/ipscan/download.php

Run ipscan.exe -> Goto the "Options" Menu -> Options -> Click on 'Only Alive' Option -> Click on OK & Save Button.
Add your Network IP range like 172.16.96.1 to 172.16.96.254 Click on Start
0
 
Farhan KaziSystems EngineerCommented:
Run ipscan.exe -> Goto the "Options" Menu -> Options -> Click on 'Select scanned columns' button -> Move 'MAC Address' field to 'Selected Columns' list. -> Click OK -> Click on 'Only Alive' Option -> Click on OK & Save Button.
0
 
bsharathAuthor Commented:
Any way to scan just the machines i want as scanning the ip range and later finding for what i want is difficult.
0
 
Farhan KaziSystems EngineerCommented:
:: ================
:: READ THIS FIRST
:: ================
:: * To run this script you must have domain administrators rights.
:: * This script require "Computers.txt" file on C: drive root from where it will pick computer names.
:: * Successful run will generate "MACRpt.txt" on C: drive root.
:: * Copy and Paste following script into notepad and save it with any name having .bat extension.
:: Batch Script Start

@Echo Off
SETLOCAL EnableDelayedExpansion

IF NOT EXIST C:\Computers.txt Goto ShowErr
FOR %%R IN (C:\Computers.txt) Do IF %%~zR EQU 0 Goto ShowErr
IF EXIST C:\MACRpt.txt DEL /F /Q C:\MACRpt.txt

FOR /F %%c IN ('Type Computers.txt') Do (
    Echo Processing: %%c
      PING -n 1 -w 1000 %%c|Find /I "TTL" >NUL
      IF NOT ErrorLevel 1 (
            SET Qry=NBTStat -a %%c ^|FIND /I "MAC Address"
            FOR /F "delims== Tokens=2" %%m IN ('!Qry!') DO (Echo %%c %%m >>C:\MACRpt.txt)
      )ELSE (Echo %%c: Not able to connect >>C:\MACRpt.txt)
)      

Goto EndScript
:ShowErr
Echo "C:\Computers.txt" file does not exist or file is empty!
:EndScript
ENDLOCAL
:: Batch Script End
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now