JR

2 minute read

Thought I’d share a nice wrapper for netsh and dnscmd calls to allow easy, bulk provisioning of new DHCP scopes. It’s nice being able to provision a ton of these at once by piping the output from Import-CSV!

 

############################
#AUTHOR:       JR Morgan
#CREATED:      20120417
#MODIFIED:     20140611
############################

<# .Synopsis Adds DHCP Scope to ALL specified DHCP servers. If split-scope is desired the script uses IP Math to automatically add the desired exlcude ranges.

.Description 
Creates a DHCP based on user-provided parameters. For 50/50 split-scope config,
the ordering of the DHCP Servers determines the upper/lower designation. The first
DHCP server specified will host upper scope portion, while the second DHCP server will
host the lower scope portion. Upper/Lower &#039;tags&#039; are added to the description when using
the Split50 switch.

.Parameter DhcpServer
    An array of DHCP Server IP names or addresses that will host the new DHCP scopes
    
.Parameter IPScope
    The desired IP Scope

.Parameter IPMask
    The desired IP mask for the scope

.Parameter Description
    A brief scope description. Upper/Lower tags will
    automatically be added if using the Split50 switch

.Parameter Gateway
    The IP address of the router or gateway for this scope (Option 3)

.Parameter Dns
    An array of DNS server IP addresses utilized by scope clients (Option 6).

.Parameter Domain
    The fully-qualified domain name for scope clients (Option 15)</code></pre>
comments powered by Disqus