Skip to content

Instantly share code, notes, and snippets.

@eguyd
Created June 17, 2019 16:48
Show Gist options
  • Save eguyd/59b6b0ece9cf51b84984538bd6539fc9 to your computer and use it in GitHub Desktop.
Save eguyd/59b6b0ece9cf51b84984538bd6539fc9 to your computer and use it in GitHub Desktop.
Configure DHCP with PowerShell. Include scope and routing.
# 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