Reading Time: < 1 minute

If Enable=True then execute the following cmdlet.
The following one-liner PowerShell cmdlet will allow you to change the default location of the Audit Log file on a DHCP Server.
Execute the following cmdlet using an elevated PowerShell Prompt from the target DHCP Server to verify that DHCP Audit Logging is enabled.
1 2 |
#Verify if DHCP Audit Log is enabled Get-DhcpServerAuditLog |

If Enable=True then execute the following cmdlet.
1 2 |
#This cmdlet will change the default location of the DHCP Audit log file under folder C:\Logs\DHCP with a maximum size of 100Mbytes Set-DhcpServerAuditLog -Path C:\Logs\DHCP -MaxMBFileSize 100 |
If Enable=False then execute the following cmdlet to enable the Audit Logging and alter the default file location.
1 2 |
#This cmdlet will enable the Audit Logging and change the default location of the DHCP Audit log file under folder C:\Logs\DHCP with a maximum size of 100Mbytes Set-DhcpServerAuditLog -Enable True -Path C:\Logs\DHCP -MaxMBFileSize 100 |
In order, the change to take place, the DHCP Service must be restarted.
1 2 |
#Restart DHCP Server Service Restart-Service DHCPServer |
Thanks for reading!