Windows – How to Log MAC Addresses of Devices Acquiring IP via DHCP

dhcpipamwindows

My network serves DHCP through a Windows 2022 server. I would like to log the MAC addresses of all devices that acquire an IP address through this DHCP server. I have installed the IPAM role in the server, but I don't understand how to activate the logging. The server is standalone; it does not use Active Directory and it's not connected to a domain.

Best Answer

Get-DhcpServerv4Lease -ComputerName "dhcpserver.contoso.com" -ScopeId 10.10.10.0

Powershell can do this for you.

Get-DhcpServerv4Lease -ComputerName <MyDHCP> -ScopeId 192.168.0.0

In the output of this function, you will find the MAC address of the clients and the status of the leases as additional information.

This is for real time information.

You can view the logs of past events (once audit logging is enabled) via these steps:

To enable enhanced DHCP logging, perform the following steps:

  1. Start the DHCP administration tool (go to Start, Programs, Administrative Tools, and click DHCP).
  2. Right-click the DHCP server, and select Properties from the context menu.
  3. Select the General tab.
  4. Select the "Enable DHCP audit logging" check box

Lots of good information on DHCP audit logs here.