In this post – http://msmvps.com/blogs/richardsiddaway/archive/2011/09/23/powershell-3-and-dhcp-2-scopes.aspx – we created a new DHCP scope.
Now we need to set some options on the scope. One of the main options we need to set is the DNS server
We can see the available options using
Get-DhcpServerv4OptionDefinition -ComputerName server02
This displays a list of the available options – remember that we can add our own so this isn’t necessarily a static list
The options that are set for the test scope are
PS> Get-DhcpServerv4OptionValue -ComputerName server02 -ScopeId 192.168.100.0
OptionId Name Type Value VendorClass UserClass PolicyName
——– —- —- —– ———– ——— ———-
51 Lease DWord {86400}
The DNS server for this scope can be set like this
PS> Set-DhcpServerv4OptionValue -ComputerName server02 -ScopeId 192.168.100.0 `
-DnsServer 10.10.54.201
OptionId Name Type Value VendorClass UserClass PolicyName
——– —- —- —– ———– ——— ———-
6 DNS Servers IPv4Add… {10.10.54.201}