Use PowerShell to Install a DHCP Server on a Windows Server 2019 (Server Core) Active Directory Domain Controller

You need to have an Active Directory domain in place. I’m picking up where I left off in my previous blog article Use PowerShell to Create a New Active Directory Forest on Windows 2019 Server Core Installation (no-GUI).

The procedure shown in this blog article is for demonstration purposes only.

Install the DHCP server feature.

Install-WindowsFeature -Name DHCP

dhcpserver1a.jpg

Add the DHCP scope to the server.

Add-DhcpServerv4Scope -Name '192.168.129.x' -StartRange 192.168.129.101 -EndRange 192.168.129.199 -SubnetMask 255.255.255.0

dhcpserver2a.jpg

Options can either be set at the scope level.

Set-DhcpServerv4OptionValue -ScopeID '192.168.129.0' -DNSServer 192.168.129.100 -DNSDomain mikefrobbins.com -Router 192.168.129.1

dhcpserver3a.jpg

Or at the server level.

Set-DhcpServerv4OptionValue -DNSServer 192.168.129.0 -DNSDomain mikefrobbins.com -Router 192.168.129.1

dhcpserver4a.jpg

Authorize the DHCP server.

Add-DhcpServerInDC -DnsName dc01.mikefrobbins.com

dhcpserver5a.jpg

Display information about the scope.

Get-DhcpServerv4Scope | Select-Object -Property *

dhcpserver6a.jpg

Warning: Do NOT connect a DHCP server to your production network without explicit permission from your corporate network team .

warning.png

The procedure shown in this blog article was deployed to an isolated Hyper-V internal network in a test lab.

ยต