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
Solved

Powershell DHCP Scope create

Posted on 2014-04-15
2
1,517 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
2 Comments
 
LVL 14

Accepted Solution

by:
Justin Yeung earned 500 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
A brief introduction to what I consider to be the best editor for PowerShell.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

861 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