Skip to content

realslacker/xDhcpServerOption119

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

xDhcpServerOption119

This DSC resource helps you to correctly configure DHCP option 119 on your Microsoft DHCP server following RFC1035. This module works best as an extension to xDhcpServer.

Example

Configuration DHCPServer {
    
    param (

        [string[]]
        $ComputerName = 'localhost'

    )

    Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
    Import-DscResource -ModuleName 'xDhcpServer' -ModuleVersion '3.1.1'
    Import-DscResource -ModuleName 'xDhcpServerOption119' -ModuleVersion '0.9'

    Node $ComputerName {

        WindowsFeature DhcpServer {
            Name   = 'Dhcp'
            Ensure = 'Present'
        }

        xDhcpServerOptionDefinition Option119 {
            AddressFamily = 'IPv4'
            OptionId      = 119
            Name          = 'DNS Suffix Search List'
            Description   = 'List of search domains encoded per RFC1035'
            Type          = 'Byte'
            VendorClass   = ''
            DefaultValue  = '0x00'
            Multivalued   = $true
            Ensure        = 'Present'
            DependsOn     = '[WindowsFeature]DhcpServer'
        }

        # note that because SearchDomains expects a string[] you must always
        # use an array, even if there is only one domain
        DhcpServerOption119 ServerValue {
            SearchDomains = @( 'domain.tld' )
            Ensure        = 'Present'
            DependsOn     = '[xDhcpServerOptionDefinition]Option119'
        }

    }

}

About

DHCP Server Option 119 DSC Resources

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published