Created
June 17, 2019 16:48
-
-
Save eguyd/59b6b0ece9cf51b84984538bd6539fc9 to your computer and use it in GitHub Desktop.
Configure DHCP with PowerShell. Include scope and routing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Guy Derenoncourt | |
# Program: DHCP Configuration with PowerShell | |
# Date Modified: 6/17/19 | |
# Disclaimer: This script is provided "AS IS" with no warranties | |
#> | |
# CONFIGURATION | |
DNSServerIP="10.0.0.10" | |
DHCPServerIP="10.0.0.10" | |
StartRange="10.0.0.50" | |
EndRange="10.0.0.254" | |
Subnet="255.255.255.0" | |
Router="10.0.0.1" | |
#> | |
# INSTALL DHCP SERVER ROLE | |
Install-WindowsFeature -Name 'DHCP' -IncludeManagementTools | |
# ADD DHCP SCOPE | |
Add-DhcpServerV4OptionValue -DnsServer 10.0.0.10 -Router 10.0.0.1 | |
# SETUP LEASE DURATION | |
Restart-service dhcpserver | |
#> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment