Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question

How do you create DHCP Administratorsand DHCP Users security groups in Local Users and Groups on the DHCP server ?

netsh dhcp add securitygroups

The following command restarts the DHCP service on the local computer.

Restart-service dhcpserver

For more information about these commands, see the following topics.

Authorize the DHCP server in Active Directory (Optional)

If you are installing DHCP in a domain environment, you must perform the following steps to authorize the DHCP server to operate in the domain.

Note

Unauthorized DHCP servers that are installed in Active Directory domains cannot function properly, and do not lease IP addresses to DHCP clients. The automatic disabling of unauthorized DHCP servers is a security feature that prevents unauthorized DHCP servers from assigning incorrect IP addresses to clients on your network.

You can use the following command to add the DHCP server to the list of authorized DHCP servers in Active Directory.

Note

If you do not have a domain environment, do not run this command.

Add-DhcpServerInDC -DnsName DHCP1.corp.contoso.com -IPAddress 10.0.0.3

To verify that the DHCP server is authorized in Active Directory, you can use the following command.

Get-DhcpServerInDC

Following are example results that are displayed in Windows PowerShell.

	IPAddress	DnsName
	---------	-------
	10.0.0.3 	DHCP1.corp.contoso.com

For more information about these commands, see the following topics.

Notify Server Manager that post-install DHCP configuration is complete (Optional)

After you have completed post-installation tasks, such as creating security groups and authorizing the DHCP server in Active Directory, Server Manager might still display an alert in the user interface stating that post-installation steps must be completed by using the DHCP Post Installation Configuration wizard.

You can prevent this now-unnecessary and inaccurate message from appearing in Server Manager by configuring the following registry key using this Windows PowerShell command.

Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 –Name ConfigurationState –Value 2

For more information about this command, see the following topic.

Set server level DNS dynamic update configuration settings (Optional)

If you want the DHCP server to perform DNS dynamic updates for DHCP client computers, you can run the following command to configure this setting. This is a server level setting, not a scope level setting, so it will affect all scopes that you configure on the server. This example command also configures the DHCP server to delete DNS resource records for clients when the client least expires.

Set-DhcpServerv4DnsSetting -ComputerName "DHCP1.corp.contoso.com" -DynamicUpdates "Always" -DeleteDnsRRonLeaseExpiry $True

You can use the following command to configure the credentials that the DHCP server uses to register or unregister client records on a DNS server. This example saves a credential on a DHCP server. The first command uses Get-Credential to create a PSCredential object, and then stores the object in the $Credential variable. The command prompts you for user name and password, so ensure that you provide credentials for an account that has permission to update resource records on your DNS server.

$Credential = Get-Credential
Set-DhcpServerDnsCredential -Credential $Credential -ComputerName "DHCP1.corp.contoso.com"

For more information about these commands, see the following topics.

Configure the Corpnet Scope

After DHCP installation is completed, you can use the following commands to configure and activate the Corpnet scope, create an exclusion range for the scope, and configure the DHCP options default gateway, DNS server IP address, and DNS domain name.

Add-DhcpServerv4Scope -name "Corpnet" -StartRange 10.0.0.1 -EndRange 10.0.0.254 -SubnetMask 255.255.255.0 -State Active`

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.0.0 -StartRange 10.0.0.1 -EndRange 10.0.0.15`

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.0.1 -ScopeID 10.0.0.0 -ComputerName DHCP1.corp.contoso.com`

Set-DhcpServerv4OptionValue -DnsDomain corp.contoso.com -DnsServer 10.0.0.2

For more information about these commands, see the following topics.

Configure the Corpnet2 Scope (Optional)

If you have a second subnet that is connected to the first subnet with a router where DHCP forwarding is enabled, you can use the following commands to add a second scope, named Corpnet2 for this example. This example also configures an exclusion range and the IP address for the default gateway (the router IP address on the subnet) of the Corpnet2 subnet.

Add-DhcpServerv4Scope -name "Corpnet2" -StartRange 10.0.1.1 -EndRange 10.0.1.254 -SubnetMask 255.255.255.0 -State Active

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.1.0 -StartRange 10.0.1.1 -EndRange 10.0.1.15

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.1.1 -ScopeID 10.0.1.0 -ComputerName DHCP1.corp.contoso.com

If you have additional subnets that are serviced by this DHCP server, you can repeat these commands, using different values for all of the command parameters, to add scopes for each subnet.

Important

Ensure that all routers between your DHCP clients and your DHCP server are configured for DHCP message forwarding. See your router documentation for information on how to configure DHCP forwarding.

Verify Server Functionality

To verify that your DHCP server is providing dynamic allocation of IP addresses to DHCP clients, you can connect another computer to a serviced subnet. After you connect the Ethernet cable to the network adapter and power on the computer, it will request an IP address from your DHCP server. You can verify successful configuration by using the ipconfig /all command and reviewing the results, or by performing connectivity tests, such as attempting to access Web resources with your browser or file shares with Windows Explorer or other applications.

If the client does not receive an IP address from your DHCP server, perform the following troubleshooting steps.

  1. Ensure that the Ethernet cable is plugged into both the computer and the Ethernet switch, hub, or router.
  2. If you plugged the client computer into a network segment that is separated from the DHCP server by a router, ensure that the router is configured to forward DHCP messages.
  3. Ensure that the DHCP server is authorized in Active Directory by running the following command to retrieve the list of authorized DHCP servers from Active Directory. Get-DhcpServerInDC.
  4. Ensure that your scopes are activated by opening the DHCP console (Server Manager, Tools, DHCP), expanding the server tree to review scopes, then right-clicking each scope. If the resulting menu includes the selection Activate, click Activate. (If the scope is already activated, the menu selection reads Deactivate.)

Windows PowerShell Commands for DHCP

The following reference provides command descriptions and syntax for all DHCP Server Windows PowerShell commands for Windows Server 2016. The topic lists commands in alphabetical order based on the verb at the beginning of the commands, such as Get or Set.

Note

You can not use Windows Server 2016 commands in Windows Server 2012 R2.

The following reference provides command descriptions and syntax for all DHCP Server Windows PowerShell commands for Windows Server 2012 R2. The topic lists commands in alphabetical order based on the verb at the beginning of the commands, such as Get or Set.

Note

You can use Windows Server 2012 R2 commands in Windows Server 2016.

List of Windows PowerShell Commands in this guide

Following is a simple list of commands and example values that are used in this guide.

New-NetIPAddress -IPAddress 10.0.0.3 -InterfaceAlias "Ethernet" -DefaultGateway 10.0.0.1 -AddressFamily IPv4 -PrefixLength 24
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 10.0.0.2
Rename-Computer -Name DHCP1
Restart-Computer

Add-Computer CORP
Restart-Computer

Install-WindowsFeature DHCP -IncludeManagementTools
netsh dhcp add securitygroups
Restart-service dhcpserver

Add-DhcpServerInDC -DnsName DHCP1.corp.contoso.com -IPAddress 10.0.0.3
Get-DhcpServerInDC

Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 –Name ConfigurationState –Value 2

Set-DhcpServerv4DnsSetting -ComputerName "DHCP1.corp.contoso.com" -DynamicUpdates "Always" -DeleteDnsRRonLeaseExpiry $True

$Credential = Get-Credential
Set-DhcpServerDnsCredential -Credential $Credential -ComputerName "DHCP1.corp.contoso.com"

rem At prompt, supply credential in form DOMAIN\user, password


rem Configure scope Corpnet

Add-DhcpServerv4Scope -name "Corpnet" -StartRange 10.0.0.1 -EndRange 10.0.0.254 -SubnetMask 255.255.255.0 -State Active

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.0.0 -StartRange 10.0.0.1 -EndRange 10.0.0.15

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.0.1 -ScopeID 10.0.0.0 -ComputerName DHCP1.corp.contoso.com

Set-DhcpServerv4OptionValue -DnsDomain corp.contoso.com -DnsServer 10.0.0.2

rem Configure scope Corpnet2

Add-DhcpServerv4Scope -name "Corpnet2" -StartRange 10.0.1.1 -EndRange 10.0.1.254 -SubnetMask 255.255.255.0 -State Active

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.1.0 -StartRange 10.0.1.1 -EndRange 10.0.1.15

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.1.1 -ScopeID 10.0.1.0 -ComputerName DHCP1.corp.contoso.com

Feedback

Send feedback about:

This product

Loading feedback...

Answer
netsh dhcp add securitygroups

Question

How do you create DHCP Administratorsand DHCP Users security groups in Local Users and Groups on the DHCP server ?

netsh dhcp add securitygroups

The following command restarts the DHCP service on the local computer.

Restart-service dhcpserver

For more information about these commands, see the following topics.

Authorize the DHCP server in Active Directory (Optional)

If you are installing DHCP in a domain environment, you must perform the following steps to authorize the DHCP server to operate in the domain.

Note

Unauthorized DHCP servers that are installed in Active Directory domains cannot function properly, and do not lease IP addresses to DHCP clients. The automatic disabling of unauthorized DHCP servers is a security feature that prevents unauthorized DHCP servers from assigning incorrect IP addresses to clients on your network.

You can use the following command to add the DHCP server to the list of authorized DHCP servers in Active Directory.

Note

If you do not have a domain environment, do not run this command.

Add-DhcpServerInDC -DnsName DHCP1.corp.contoso.com -IPAddress 10.0.0.3

To verify that the DHCP server is authorized in Active Directory, you can use the following command.

Get-DhcpServerInDC

Following are example results that are displayed in Windows PowerShell.

	IPAddress	DnsName
	---------	-------
	10.0.0.3 	DHCP1.corp.contoso.com

For more information about these commands, see the following topics.

Notify Server Manager that post-install DHCP configuration is complete (Optional)

After you have completed post-installation tasks, such as creating security groups and authorizing the DHCP server in Active Directory, Server Manager might still display an alert in the user interface stating that post-installation steps must be completed by using the DHCP Post Installation Configuration wizard.

You can prevent this now-unnecessary and inaccurate message from appearing in Server Manager by configuring the following registry key using this Windows PowerShell command.

Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 –Name ConfigurationState –Value 2

For more information about this command, see the following topic.

Set server level DNS dynamic update configuration settings (Optional)

If you want the DHCP server to perform DNS dynamic updates for DHCP client computers, you can run the following command to configure this setting. This is a server level setting, not a scope level setting, so it will affect all scopes that you configure on the server. This example command also configures the DHCP server to delete DNS resource records for clients when the client least expires.

Set-DhcpServerv4DnsSetting -ComputerName "DHCP1.corp.contoso.com" -DynamicUpdates "Always" -DeleteDnsRRonLeaseExpiry $True

You can use the following command to configure the credentials that the DHCP server uses to register or unregister client records on a DNS server. This example saves a credential on a DHCP server. The first command uses Get-Credential to create a PSCredential object, and then stores the object in the $Credential variable. The command prompts you for user name and password, so ensure that you provide credentials for an account that has permission to update resource records on your DNS server.

$Credential = Get-Credential
Set-DhcpServerDnsCredential -Credential $Credential -ComputerName "DHCP1.corp.contoso.com"

For more information about these commands, see the following topics.

Configure the Corpnet Scope

After DHCP installation is completed, you can use the following commands to configure and activate the Corpnet scope, create an exclusion range for the scope, and configure the DHCP options default gateway, DNS server IP address, and DNS domain name.

Add-DhcpServerv4Scope -name "Corpnet" -StartRange 10.0.0.1 -EndRange 10.0.0.254 -SubnetMask 255.255.255.0 -State Active`

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.0.0 -StartRange 10.0.0.1 -EndRange 10.0.0.15`

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.0.1 -ScopeID 10.0.0.0 -ComputerName DHCP1.corp.contoso.com`

Set-DhcpServerv4OptionValue -DnsDomain corp.contoso.com -DnsServer 10.0.0.2

For more information about these commands, see the following topics.

Configure the Corpnet2 Scope (Optional)

If you have a second subnet that is connected to the first subnet with a router where DHCP forwarding is enabled, you can use the following commands to add a second scope, named Corpnet2 for this example. This example also configures an exclusion range and the IP address for the default gateway (the router IP address on the subnet) of the Corpnet2 subnet.

Add-DhcpServerv4Scope -name "Corpnet2" -StartRange 10.0.1.1 -EndRange 10.0.1.254 -SubnetMask 255.255.255.0 -State Active

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.1.0 -StartRange 10.0.1.1 -EndRange 10.0.1.15

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.1.1 -ScopeID 10.0.1.0 -ComputerName DHCP1.corp.contoso.com

If you have additional subnets that are serviced by this DHCP server, you can repeat these commands, using different values for all of the command parameters, to add scopes for each subnet.

Important

Ensure that all routers between your DHCP clients and your DHCP server are configured for DHCP message forwarding. See your router documentation for information on how to configure DHCP forwarding.

Verify Server Functionality

To verify that your DHCP server is providing dynamic allocation of IP addresses to DHCP clients, you can connect another computer to a serviced subnet. After you connect the Ethernet cable to the network adapter and power on the computer, it will request an IP address from your DHCP server. You can verify successful configuration by using the ipconfig /all command and reviewing the results, or by performing connectivity tests, such as attempting to access Web resources with your browser or file shares with Windows Explorer or other applications.

If the client does not receive an IP address from your DHCP server, perform the following troubleshooting steps.

  1. Ensure that the Ethernet cable is plugged into both the computer and the Ethernet switch, hub, or router.
  2. If you plugged the client computer into a network segment that is separated from the DHCP server by a router, ensure that the router is configured to forward DHCP messages.
  3. Ensure that the DHCP server is authorized in Active Directory by running the following command to retrieve the list of authorized DHCP servers from Active Directory. Get-DhcpServerInDC.
  4. Ensure that your scopes are activated by opening the DHCP console (Server Manager, Tools, DHCP), expanding the server tree to review scopes, then right-clicking each scope. If the resulting menu includes the selection Activate, click Activate. (If the scope is already activated, the menu selection reads Deactivate.)

Windows PowerShell Commands for DHCP

The following reference provides command descriptions and syntax for all DHCP Server Windows PowerShell commands for Windows Server 2016. The topic lists commands in alphabetical order based on the verb at the beginning of the commands, such as Get or Set.

Note

You can not use Windows Server 2016 commands in Windows Server 2012 R2.

The following reference provides command descriptions and syntax for all DHCP Server Windows PowerShell commands for Windows Server 2012 R2. The topic lists commands in alphabetical order based on the verb at the beginning of the commands, such as Get or Set.

Note

You can use Windows Server 2012 R2 commands in Windows Server 2016.

List of Windows PowerShell Commands in this guide

Following is a simple list of commands and example values that are used in this guide.

New-NetIPAddress -IPAddress 10.0.0.3 -InterfaceAlias "Ethernet" -DefaultGateway 10.0.0.1 -AddressFamily IPv4 -PrefixLength 24
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 10.0.0.2
Rename-Computer -Name DHCP1
Restart-Computer

Add-Computer CORP
Restart-Computer

Install-WindowsFeature DHCP -IncludeManagementTools
netsh dhcp add securitygroups
Restart-service dhcpserver

Add-DhcpServerInDC -DnsName DHCP1.corp.contoso.com -IPAddress 10.0.0.3
Get-DhcpServerInDC

Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 –Name ConfigurationState –Value 2

Set-DhcpServerv4DnsSetting -ComputerName "DHCP1.corp.contoso.com" -DynamicUpdates "Always" -DeleteDnsRRonLeaseExpiry $True

$Credential = Get-Credential
Set-DhcpServerDnsCredential -Credential $Credential -ComputerName "DHCP1.corp.contoso.com"

rem At prompt, supply credential in form DOMAIN\user, password


rem Configure scope Corpnet

Add-DhcpServerv4Scope -name "Corpnet" -StartRange 10.0.0.1 -EndRange 10.0.0.254 -SubnetMask 255.255.255.0 -State Active

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.0.0 -StartRange 10.0.0.1 -EndRange 10.0.0.15

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.0.1 -ScopeID 10.0.0.0 -ComputerName DHCP1.corp.contoso.com

Set-DhcpServerv4OptionValue -DnsDomain corp.contoso.com -DnsServer 10.0.0.2

rem Configure scope Corpnet2

Add-DhcpServerv4Scope -name "Corpnet2" -StartRange 10.0.1.1 -EndRange 10.0.1.254 -SubnetMask 255.255.255.0 -State Active

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.1.0 -StartRange 10.0.1.1 -EndRange 10.0.1.15

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.1.1 -ScopeID 10.0.1.0 -ComputerName DHCP1.corp.contoso.com

Feedback

Send feedback about:

This product

Loading feedback...

Answer
?

Question

How do you create DHCP Administratorsand DHCP Users security groups in Local Users and Groups on the DHCP server ?

netsh dhcp add securitygroups

The following command restarts the DHCP service on the local computer.

Restart-service dhcpserver

For more information about these commands, see the following topics.

Authorize the DHCP server in Active Directory (Optional)

If you are installing DHCP in a domain environment, you must perform the following steps to authorize the DHCP server to operate in the domain.

Note

Unauthorized DHCP servers that are installed in Active Directory domains cannot function properly, and do not lease IP addresses to DHCP clients. The automatic disabling of unauthorized DHCP servers is a security feature that prevents unauthorized DHCP servers from assigning incorrect IP addresses to clients on your network.

You can use the following command to add the DHCP server to the list of authorized DHCP servers in Active Directory.

Note

If you do not have a domain environment, do not run this command.

Add-DhcpServerInDC -DnsName DHCP1.corp.contoso.com -IPAddress 10.0.0.3

To verify that the DHCP server is authorized in Active Directory, you can use the following command.

Get-DhcpServerInDC

Following are example results that are displayed in Windows PowerShell.

	IPAddress	DnsName
	---------	-------
	10.0.0.3 	DHCP1.corp.contoso.com

For more information about these commands, see the following topics.

Notify Server Manager that post-install DHCP configuration is complete (Optional)

After you have completed post-installation tasks, such as creating security groups and authorizing the DHCP server in Active Directory, Server Manager might still display an alert in the user interface stating that post-installation steps must be completed by using the DHCP Post Installation Configuration wizard.

You can prevent this now-unnecessary and inaccurate message from appearing in Server Manager by configuring the following registry key using this Windows PowerShell command.

Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 –Name ConfigurationState –Value 2

For more information about this command, see the following topic.

Set server level DNS dynamic update configuration settings (Optional)

If you want the DHCP server to perform DNS dynamic updates for DHCP client computers, you can run the following command to configure this setting. This is a server level setting, not a scope level setting, so it will affect all scopes that you configure on the server. This example command also configures the DHCP server to delete DNS resource records for clients when the client least expires.

Set-DhcpServerv4DnsSetting -ComputerName "DHCP1.corp.contoso.com" -DynamicUpdates "Always" -DeleteDnsRRonLeaseExpiry $True

You can use the following command to configure the credentials that the DHCP server uses to register or unregister client records on a DNS server. This example saves a credential on a DHCP server. The first command uses Get-Credential to create a PSCredential object, and then stores the object in the $Credential variable. The command prompts you for user name and password, so ensure that you provide credentials for an account that has permission to update resource records on your DNS server.

$Credential = Get-Credential
Set-DhcpServerDnsCredential -Credential $Credential -ComputerName "DHCP1.corp.contoso.com"

For more information about these commands, see the following topics.

Configure the Corpnet Scope

After DHCP installation is completed, you can use the following commands to configure and activate the Corpnet scope, create an exclusion range for the scope, and configure the DHCP options default gateway, DNS server IP address, and DNS domain name.

Add-DhcpServerv4Scope -name "Corpnet" -StartRange 10.0.0.1 -EndRange 10.0.0.254 -SubnetMask 255.255.255.0 -State Active`

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.0.0 -StartRange 10.0.0.1 -EndRange 10.0.0.15`

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.0.1 -ScopeID 10.0.0.0 -ComputerName DHCP1.corp.contoso.com`

Set-DhcpServerv4OptionValue -DnsDomain corp.contoso.com -DnsServer 10.0.0.2

For more information about these commands, see the following topics.

Configure the Corpnet2 Scope (Optional)

If you have a second subnet that is connected to the first subnet with a router where DHCP forwarding is enabled, you can use the following commands to add a second scope, named Corpnet2 for this example. This example also configures an exclusion range and the IP address for the default gateway (the router IP address on the subnet) of the Corpnet2 subnet.

Add-DhcpServerv4Scope -name "Corpnet2" -StartRange 10.0.1.1 -EndRange 10.0.1.254 -SubnetMask 255.255.255.0 -State Active

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.1.0 -StartRange 10.0.1.1 -EndRange 10.0.1.15

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.1.1 -ScopeID 10.0.1.0 -ComputerName DHCP1.corp.contoso.com

If you have additional subnets that are serviced by this DHCP server, you can repeat these commands, using different values for all of the command parameters, to add scopes for each subnet.

Important

Ensure that all routers between your DHCP clients and your DHCP server are configured for DHCP message forwarding. See your router documentation for information on how to configure DHCP forwarding.

Verify Server Functionality

To verify that your DHCP server is providing dynamic allocation of IP addresses to DHCP clients, you can connect another computer to a serviced subnet. After you connect the Ethernet cable to the network adapter and power on the computer, it will request an IP address from your DHCP server. You can verify successful configuration by using the ipconfig /all command and reviewing the results, or by performing connectivity tests, such as attempting to access Web resources with your browser or file shares with Windows Explorer or other applications.

If the client does not receive an IP address from your DHCP server, perform the following troubleshooting steps.

  1. Ensure that the Ethernet cable is plugged into both the computer and the Ethernet switch, hub, or router.
  2. If you plugged the client computer into a network segment that is separated from the DHCP server by a router, ensure that the router is configured to forward DHCP messages.
  3. Ensure that the DHCP server is authorized in Active Directory by running the following command to retrieve the list of authorized DHCP servers from Active Directory. Get-DhcpServerInDC.
  4. Ensure that your scopes are activated by opening the DHCP console (Server Manager, Tools, DHCP), expanding the server tree to review scopes, then right-clicking each scope. If the resulting menu includes the selection Activate, click Activate. (If the scope is already activated, the menu selection reads Deactivate.)

Windows PowerShell Commands for DHCP

The following reference provides command descriptions and syntax for all DHCP Server Windows PowerShell commands for Windows Server 2016. The topic lists commands in alphabetical order based on the verb at the beginning of the commands, such as Get or Set.

Note

You can not use Windows Server 2016 commands in Windows Server 2012 R2.

The following reference provides command descriptions and syntax for all DHCP Server Windows PowerShell commands for Windows Server 2012 R2. The topic lists commands in alphabetical order based on the verb at the beginning of the commands, such as Get or Set.

Note

You can use Windows Server 2012 R2 commands in Windows Server 2016.

List of Windows PowerShell Commands in this guide

Following is a simple list of commands and example values that are used in this guide.

New-NetIPAddress -IPAddress 10.0.0.3 -InterfaceAlias "Ethernet" -DefaultGateway 10.0.0.1 -AddressFamily IPv4 -PrefixLength 24
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 10.0.0.2
Rename-Computer -Name DHCP1
Restart-Computer

Add-Computer CORP
Restart-Computer

Install-WindowsFeature DHCP -IncludeManagementTools
netsh dhcp add securitygroups
Restart-service dhcpserver

Add-DhcpServerInDC -DnsName DHCP1.corp.contoso.com -IPAddress 10.0.0.3
Get-DhcpServerInDC

Set-ItemProperty –Path registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ServerManager\Roles\12 –Name ConfigurationState –Value 2

Set-DhcpServerv4DnsSetting -ComputerName "DHCP1.corp.contoso.com" -DynamicUpdates "Always" -DeleteDnsRRonLeaseExpiry $True

$Credential = Get-Credential
Set-DhcpServerDnsCredential -Credential $Credential -ComputerName "DHCP1.corp.contoso.com"

rem At prompt, supply credential in form DOMAIN\user, password


rem Configure scope Corpnet

Add-DhcpServerv4Scope -name "Corpnet" -StartRange 10.0.0.1 -EndRange 10.0.0.254 -SubnetMask 255.255.255.0 -State Active

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.0.0 -StartRange 10.0.0.1 -EndRange 10.0.0.15

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.0.1 -ScopeID 10.0.0.0 -ComputerName DHCP1.corp.contoso.com

Set-DhcpServerv4OptionValue -DnsDomain corp.contoso.com -DnsServer 10.0.0.2

rem Configure scope Corpnet2

Add-DhcpServerv4Scope -name "Corpnet2" -StartRange 10.0.1.1 -EndRange 10.0.1.254 -SubnetMask 255.255.255.0 -State Active

Add-DhcpServerv4ExclusionRange -ScopeID 10.0.1.0 -StartRange 10.0.1.1 -EndRange 10.0.1.15

Set-DhcpServerv4OptionValue -OptionID 3 -Value 10.0.1.1 -ScopeID 10.0.1.0 -ComputerName DHCP1.corp.contoso.com

Feedback

Send feedback about:

This product

Loading feedback...

Answer
netsh dhcp add securitygroups
If you want to change selection, open document below and click on "Move attachment"

Deploy DHCP Using Windows PowerShell | Microsoft Docs
become active. When you run the following netsh command on the DHCP server, the DHCP Administrators and DHCP Users security groups are created in Local Users and Groups on the DHCP server. Copy <span>netsh dhcp add securitygroups The following command restarts the DHCP service on the local computer. Copy Restart-service dhcpserver For more information about these commands, see the following topics. Network Shell

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.