On Mon, Aug 4, 2008 at 9:13 AM, Glen Holcomb <damnbigman / gmail.com> wrote:
> This whole thing started as a tool to shutdown certain machines at certain
> times in the evening and then wake them (WOL) at a scheduled time in the
> morning to be ready for classes.  I only manage three labs so it wasn't a
> big deal to input the MAC addresses by hand.  However the larger IT
> department here at the school has taken notice and is interested in using it
> to manage machines institution wide.
>
> Since they have over a thousand machines they manage the current idea is to
> populate both the computer db entries and the group/lab/area db entries from
> LDAP/AD.  Hence my quest for an easily automated way to get MAC addresses,
> machine names are easy (LDAP/AD) and IP is also easy, at least assuming DNS
> is correct it is.

If you are talking about mainly Windows boxes and they still have the
NetBIOS bits enabled, try nbtstat:

C:\>nbtstat -A 172.16.121.11

Local Area Connection:
Node IpAddress: [172.16.121.54] Scope Id: []

           NetBIOS Remote Machine Name Table

       Name               Type         Status
    ---------------------------------------------
...

    MAC Address = XX-XX-XX-XX-XX-XX

C:\>nbtstat -A 172.16.23.204

Local Area Connection:
Node IpAddress: [172.16.121.54] Scope Id: []

           NetBIOS Remote Machine Name Table

       Name               Type         Status
    ---------------------------------------------
...

    MAC Address = XX-XX-XX-XX-XX-XX