PowerShell for Windows Admins

Oct 2 2011   1:21PM GMT

PowerShell 3 and DHCP: scope options



Posted by: Richard Siddaway
Tags:
PowerShell 3
Windows 8

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}

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: