locked
Get Mac Address for remote Domain Computers based on IP or hostname - Both online and Off RRS feed

  • Question

  • Hello,

    I'm Using Get-ADComputer to query information about our clients. Once I have the Name, OS, LastlogonDate, etc, then I use 

    Resolve-DNSName to get an array(of 1 ip somtimes) of IP addresses for the given host. Is there a similar cmdlet or other process to query say the DHCP servers and get the MAC address that would be associated with each IP?

    I've seen many posts on approaching this from several angles but it appears in all those cases, the host needs to be online. I need to get this info weather the systems are on or off.

    Thanks

    Thursday, January 31, 2019 10:54 PM

Answers

  • You can also install RSAT which contains the DHCP cmdlets.  You will need to install it on Windows 7 or later and use the correct version.

    \_(ツ)_/

    • Marked as answer by mmurphy58 Friday, February 1, 2019 9:39 PM
    Thursday, January 31, 2019 11:31 PM

All replies

  • Thursday, January 31, 2019 11:09 PM
  • I was trying to work with this on a windows 10 client, but apparently this will only work on a server 2012 and up with a dhcp server installed. I was hoping to not have to do it that way.

    Thank You

    Thursday, January 31, 2019 11:17 PM
  • Well , Even on the windows Server 2012 R2 with DHCP Get-Dhcpserver4Lease error no cmdlet named that exist
    Thursday, January 31, 2019 11:23 PM
  • You can remote it.   Just use Invoke-Command.

    You can also use WMI.

    $namespace = 'root/Microsoft/Windows/DHCP'
    $class = 'DhcpServerv4OptionValue'


    \_(ツ)_/

    Thursday, January 31, 2019 11:26 PM
  • You can also install RSAT which contains the DHCP cmdlets.  You will need to install it on Windows 7 or later and use the correct version.

    \_(ツ)_/

    • Marked as answer by mmurphy58 Friday, February 1, 2019 9:39 PM
    Thursday, January 31, 2019 11:31 PM