script to get MAC address info. from DHCP

Discussion in 'Scripting' started by SalemOR97301, Sep 12, 2008.

  1. SalemOR97301

    SalemOR97301 Guest

    I have an application that I need to import all the MAC addresses for all
    hostnames into. I haven't found a way other than to an nbtstat -a
    COMPUTERNAME. Of course the only issue with that one is the machines have to
    be powered on to get a result. Is there any way to extract the MAC address
    from DHCP?

    Thank You,

    --GT--
     
    SalemOR97301, Sep 12, 2008
    #1
    1. Advertisements

  2. Try with netsh:

    C:\> netsh -c dhcp server scope 192.168.1.0 show clients



    ---
    Shay Levy
    Windows PowerShell MVP
    http://blogs.microsoft.co.il/blogs/ScriptFanatic
    PowerShell Toolbar: http://tinyurl.com/PSToolbar


    S> I have an application that I need to import all the MAC addresses for
    S> all hostnames into. I haven't found a way other than to an nbtstat -a
    S> COMPUTERNAME. Of course the only issue with that one is the machines
    S> have to be powered on to get a result. Is there any way to extract
    S> the MAC address from DHCP?
    S>
    S> Thank You,
    S>
    S> --GT--
    S>
     
    Shay Levy [MVP], Sep 16, 2008
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.