Solved

Powershell DHCP Scope create

Posted on 2014-04-15
2
1,447 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
Comment Utility
$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
Comment Utility
Exactly what is needed; thank you!
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Join & Write a Comment

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now