PowerShell DHCP command generator (Windows Server)
Parametric generator for the Windows DhcpServer PowerShell module. Fill in the DHCP server hostname, scope, MAC, and other values once — every command on the page substitutes them in real time. Covers queries, reservations, bulk imports (CSV + inline), scope management, common DHCP options (66 / 67 / 150 / 43), and server diagnostics.
⚠ Disclaimer
These commands are provided as-is, for educational and planning purposes only. Run only against DHCP servers you are authorised to operate. Always export a full server backup first (
Export-DhcpServer ... -Leases -Force) and test destructive operations in a maintenance window. Bulk reservation changes can take a scope offline; DHCP option mistakes can break phones / PXE / VoIP for an entire site. The Tech Space makes no warranty and accepts no liability. Full disclaimer →
Before you start: these cmdlets come from the
DhcpServer module (part of RSAT). On the management workstation run Install-WindowsFeature -Name RSAT-DHCP (server) or Get-WindowsCapability -Online -Name Rsat.Dhcp* → Add-WindowsCapability -Online -Name <name> (client). You'll also need a domain account with DHCP Administrators rights (or local Administrator on the DHCP server). Use -WhatIf on any destructive cmdlet to preview the change before committing.
Variables · fill in your values
MAC accepts any common format (colons / hyphens / dots / no separator) and is auto-normalised to 00-11-22-33-44-55 for PowerShell. Values persist in your browser between visits.
Reference
Lease duration format
1.00:00:001 day8.00:00:008 days (Windows default)00:08:008 minutes (PXE / lab use)04:00:004 hours- Format:
[d.]hh:mm:ss
Common DHCP options
3Router (default gateway)6DNS servers (IP array)15DNS domain name42NTP servers (IP array)43Vendor-specific info (binary / hex)60Vendor class identifier66TFTP server name (string)67Boot file name (string)119DNS domain search list120SIP server address (IP phones)150Cisco IP phone TFTP (IP array)
Reservation Type values
BothDHCP + BOOTP (default)DhcpDHCP onlyBootpBOOTP onlyNoneDisabled (reservation kept but inactive)
Scope State values
ActiveScope serving leasesInActiveScope present but not serving
Note the capitalisation: PowerShell expects InActive (one word, capital I and A) — not Inactive.
Address State values (leases)
ActiveCurrently leasedDeclinedClient declined the leaseExpiredLease window passedInactiveReservationReservation, not currently in useActiveReservationReservation, in use
Useful safety patterns
-WhatIfPreview a destructive cmdlet-Confirm:$falseSuppress confirmation in scripts-ErrorAction StopConvert non-terminating errors to terminating (for try/catch)-VerboseShow progress on bulk operations