This is a tool I use often - [url]http://www.softperfect.com/products/networkscanner/[/url]
You can use it as ssx4life mention, to scan the network and export the computer names and macs.
If you want a slightly more automatish way of extracting macs from your domain you can actually query the dhcp server with netsh.
We have a lease time of 3 days so I have a script (mixed with grep and sed from unix tools - [url]http://unxutils.sourceforge.net/[/url] ) to query the dhcp server and extract the macs to a file, then filter and export to a bigger / master file that I use for wake on lan scripts (nightly virus scans).
Here’s a script I use (you can amend to include the computer name)
[CODE]:: Script to extract mac addresses from DHCP for both subnets.
:: Delete macsDB.txt if exists
if exist “C:\scripts\WOL\newMACs.txt” del “c:\scripts\WOL\newMACs.txt”
:: Query for MACs on 2 subnets
for %%a in (22,23) do netsh -c dhcp server 10.10.%%a.25 scope 10.10.%%a.0 show clients | grep 255.255.255.0 | sed s/-" "//g | sed s/."255.255.255.0 “//g | cut -d” " -f 2 | grep -Fvf macsDB.txt >> newMACs.txt
type newMACs.txt >> macsDB.txt
:: WOL - SUBNET 1
for /f “tokens=* delims=” %%a in (macsDB.txt) do wolcmd %%a 10.10.22.0 255.255.255.0 7[/CODE]
I have a scheduled task that runs the above script, but the essential part is the “netsh -c dhcp server <ip of dhcp server> <subnet> show clients”
That should show you the current clients based on your lease time, run repeatedly (according to your lease time) to build up a list of valid macs.