A Step-by-Step Guide to Configuring DHCP on Windows Server 2016 Using GUI and PowerShell.
Con GUI
1. Correre IL DHCP console from the apps list. Vai a IPv4\Server Options. There we config Server options for all scopes;
2. Pulsante mouse destro Clicca a Server Options e fare clic Configure Options;
3. Select option 006 DNS Servers, entrare an IP address, e fare clic Aggiungere;
4. Select option 015 DNS Domain Name, enter the domain name, e fare clic OK;
5. New options added;
6. Pulsante mouse destro Clicca a IPv4 e fare clic New Scope;
7. Clic Prossimo;
8. Entra Nome (and if you wish Description), e fare clic Prossimo;
9. Entra the Start IP address, End IP address, E Subnet mask, e fare clic Prossimo;
10. On this page, you may exclude the IP range from DHCP. Clic Prossimo;
11. Impostato Lease Duration e fare clic Prossimo;
12. You may select SÌ and configure Scope Options for this scope. I choose NO, clic Prossimo;
13. Clic Fine;
14. Scope created, but we must Activate it;
15. Pulsante mouse destro click at the scope and click Activate;
16. Scope activated and worked!
17. Se tu Pulsante mouse destro fare clic su Leased IP Address, you may Add to the reservation Add to the filter, o anche Delete it;
Con PowerShell
1. Correre PowerShell come amministratore. To get active scopes enter:
Get-DhcpServerv4Scope -cn <dhcp server name> | select scopeid, name, description
PowerShell2. To add new scope, entrare:
Add-DhcpServerv4Scope -Name ‘<scope name>’ -StartRange <start IP Address> -EndRange <end IP Address> -SubnetMask <subnet mask> -Description ‘<description>’ –cn <dhcp server name>
PowerShell3. Before scope delete Best Practices is run the command with WhatIf parameter:
Remove-DhcpServerv4Scope -ScopeId <scope id> -cn <dhcp server name> -WhatIf
PowerShell4. Then run without the WhatIf parameter:
Remove-DhcpServerv4Scope -ScopeId <scope id> -cn <dhcp server name>
PowerShell5. Scope removed.