Solved

Powershell DHCP Scope create

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

This script checks a path to see if a folder exists. If the folder does exist you will get output "The folder has previously been created. No action taken" If not it will create the folder. Then adds one user modify permission to the folder. It …
Microsoft Windows Server Update Service (WSUS) is free for everyone, but it lacks of some desirable features like send an e-mail to the administrator with the status of all computers on the WSUS server. This article is based on my PowerShell script …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

930 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

11 Experts available now in Live!

Get 1:1 Help Now