PS-DHCP

Install

Install-WindowsFeature -IncludeManagementTools DHCP

Examples

Backup

Backup-DhcpServer -ComputerName "myDHCPserver.mydomain" -Path "C:\mybackupdir"

View Leases

Get-DhcpServerv4Scope | Get-DhcpServerv4Lease

Find Lease by MAC Address

Get-DhcpServerv4Scope |Get-DhcpServerv4Lease |where {$_.ClientId -like “b1-b2-33-b4-**-**” }

Add Scope

Add-DHCPServerv4Scope -EndRange 10.2.1.254 -Name myVLan -StartRange 10.2.1.1 -SubnetMask 255.255.255.0 -State Active

Get all active ipv4 scopes

Get-DHCPServerv4Scope

Get DHCP reservations for a scope

Get-DHCPServerv4Lease -ScopeId 10.2.1.0

Create a DHCP reservation

Get-DhcpServerv4Lease -ComputerName dhcpserver1 -IPAddress 10.2.1.8 | Add-DhcpServerv4Reservation -ComputerName server1

Bibliography