Solved

Powershell DHCP Scope create

Posted on 2014-04-15
2
1,500 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

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…
Set OWA language and time zone in Exchange for individuals, all users or per database.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 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