DHCP Server Installation and Configuration using Powershell

This tutorial shows how to install a DHCP server using Powershell.
You can install DHCP on a domain controller or on a separate server. For this tutorial a Windows Server 2016 Standard Edition server has been used without Desktop Experience. The server is a Domain Controller with hostname ‘adds01.lab01.local’ and has ip-address

Log in to the server that will become the DHCP server as Domain Administrator. A Command Shell is shown. Type ‘powershell’ and hit enter.

First, install DHCP using the Install-WindowsFeature cmdlet.

Install-WindowsFeature dhcp


Now add the DHCP server to AD DS and authorize it using the Add-DhcpServerInDC cmdlet.


Add-DhcpServerInDC -DnsName adds01.lab01.local -IPAddress


Create the first scope by using the Add-DhcpServerv4Scope cmdlet.


Add-DhcpServerv4Scope -Name Scope01 -StartRange -EndRange -SubnetMask


To show the DHCP scope, use the Get-DhcpServerv4Scope cmdlet.



Remember the ScopeId, because you will need this when you want to add options to the scope.
Now add some basic options to the scope using the Set-DhcpServerv4OptionValue cmdlet. For this example, set the dnsdomain, dnsserver and the router values.


Set-DhcpServerv4OptionValue -ScopeId -DnsDomain lab01.local -DnsServer -Router

If you don’t specify the ScopeId, the Option Values will be Server Options instead of Scope Options.


The DHCP server installation and configuration has finished. The server can now offer ip-addresses to DHCP clients.

2 thoughts on “DHCP Server Installation and Configuration using Powershell

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.