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.
#Verify if DHCP Audit Log is enabled
Get-DhcpServerAuditLog
If Enable=True then execute the following cmdlet.
#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.
#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.
#Restart DHCP Server Service
Restart-Service DHCPServer
Thanks for reading my blog!
Feel free to drop your comment or question below.
You must be logged in to post a comment.