?
Solved

Powershell DHCP Scope create

Posted on 2014-04-15
2
Medium Priority
?
1,649 Views
Last Modified: 2014-04-15
I have been trolling for creating DHCP scopes, but am having a tough time putting in the Exclusions and options. Here is what I have right now:

Add-DhcpServerv4Scope -Name 'Retail Lab 1' -StartRange 172.28.1.12 -EndRange 172.28.1.126 -SubnetMask 255.255.255.0 -Description 'Lab 1, PCI Scope Lower' –cn hqdc03

-->I need to add...
PCI Scope
Excluded
172.28.1.110 - 172.28.1.126
Range
172.28.1.12 - 172.28.1.126
Options
003 Router 172.28.1.1
006 DNS Servers 172.19.222.116,172.19.223.116,172.17.206.40
044 WINS/NBNS Servers 172.19.222.116,172.19.223.116,172.17.206.40
046 WINS/NBT Type 0x8
015 DNS Domain Name newcorpnet.com
0
Comment
Question by:johndarby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 14

Accepted Solution

by:
Justin Yeung earned 2000 total points
ID: 40002075
$DHCPserverFQDN = "your dhcp server fqdn"
$Scope = "your dhcp scope address"

$DHCPScope = Get-dhcpscope -server $DHCPserverFQDN -scope $Scope

$DHCPScope | Add-DHCPExclusionRange -Server $DHCPserverFQDN -Scope 172.28.1.12 -StartAddress 172.28.1.110 -EndAddress 172.26.1.126

$DHCPScope | Set-DHCPOption -OptionID 3 -DataType IPADDRESS -Value "172.28.1.1"
$DHCPScope | Set-DHCPOption -OptionID 6 -DataType IPADDRESS -Value " 
172.19.222.116,172.19.223.116,172.17.206.40"
$DHCPScope | Set-DHCPOption -OptionID 44 -DataType IPADDRESS -Value "172.19.222.116,172.19.223.116,172.17.206.40"
$DHCPScope | Set-DHCPOption -OptionID 46 -DataType BYTE -Value "0x8"
$DHCPScope | Set-DHCPOption -OptionID 15 -DataType  STRING -Value "newcorpnet.com "
0
 
LVL 1

Author Closing Comment

by:johndarby
ID: 40002083
Exactly what is needed; thank you!
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A brief introduction to what I consider to be the best editor for PowerShell.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question