Hero Banner

Products Discussions

Share best practices and get the latest Microsoft product info

Reply
Level 2 Contributor

configure dhcp scope using powershell

hello i would like to create a powershell that will add the following dhcp scope

 

network - 10.0.0.0 /24

range 10.0.0.1-254

exclusions 10.0.0.1-50

router -10.0.0.1

dns -8.8.8.8

domain -domain.com

 

 

what is the syntax?

3 REPLIES 3
Level 2 Contributor

i got most of it working . thanks for the links. 

 

i am stuck on one thing and i cant seem to find the syntax

 

i am trying to configure multiple DNS servers for a specific scope using Powershell. Does anyone know how to perform this?

 

here is what i currently am using. 

 

Set-DhcpServerv4OptionValue  -ScopeId 10.10.10.0 -OptionId 6 -Value "8.8.8.8"

 

If i use a comma (such as Value "8.8.8.8,1.1.1.1" it still only adds a single dns entry. another way to do it?

Level 6 Contributor

did you try?

Value "8.8.8.8", "1.1.1.1"