Repository navigation
xDhcpServerOptionDefinition
dscbot edited this page Oct 16, 2025
·
6 revisions
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| AddressFamily | Key | String | Class address family. Currently needs to be IPv4. | IPv4 |
| OptionId | Key | UInt32 | Option ID, specify a number between 1 and 255. | |
| VendorClass | Key | String | Vendor class. Use an empty string for standard option class. | |
| Name | Required | String | Option name. | |
| Type | Required | String | Option data type. |
Byte, Word, Dword, DwordDword, IPv4Address, String, BinaryData, EncapsulatedData
|
| DefaultValue | Write | String | Default value for the option. | |
| Description | Write | String | Option description. | |
| Ensure | Write | String | Whether the DHCP server class should exist. |
Present, Absent
|
| Multivalued | Write | Boolean | Whether option is multi-valued or not. |
The xDhcpServerOptionDefinition DSC resource manages DHCP option definitions.
- Target machine must be running Windows Server 2012 R2 or later.
- Target machine must be running at minimum Windows PowerShell 5.0.
This example creates two new DHCP Server option definitions.
configuration Example
{
Import-DscResource -ModuleName 'PSDscResources' -ModuleVersion '2.12.0.0'
Import-DscResource -moduleName 'DhcpServerDsc'
WindowsFeature 'DHCP'
{
Name = 'DHCP'
Ensure = 'Present'
}
xDhcpServerOptionDefinition 'DHCPServerOptionDefinition1'
{
Ensure = 'Present'
Name = 'Cisco AP c1700 Provisioning'
OptionID = '200'
Type = 'IPv4Address'
AddressFamily = 'IPv4'
VendorClass = 'Cisco AP c1700'
Description = 'Sample description'
}
xDhcpServerOptionDefinition 'DHCPServerOptionDefinition2'
{
Ensure = 'Present'
Name = 'sample name'
OptionID = '200'
Type = 'IPv4Address'
AddressFamily = 'IPv4'
VendorClass = '' #default option class
Description = 'Sample description'
}
xDhcpServerOptionDefinition 'DHCPServerOptionDefinition3'
{
Ensure = 'Present'
Name = 'PXEClient'
OptionID = '060'
Type = 'String'
AddressFamily = 'IPv4'
VendorClass = '' #default option class
Description = 'Sample description'
DefaultValue = 'PXEClient'
}
}