Skip to content

DhcpClient

Daniel Scott-Raynsford edited this page Feb 22, 2019 · 3 revisions

DhcpClient

Warning! This resource has been deprecated as of v7.0.0.0. Please use the Dhcp property of the NetIPInterface resource instead.

Parameters

Parameter Attribute DataType Description Allowed Values
InterfaceAlias Key string Alias of the network interface for which the DHCP Client is set.
AddressFamily Key string IP address family. IPv4, IPv6
State Required string The desired state of the DHCP Client. Enabled, Disabled

Description

The resource is responsible for creating and managing DHCP Clients for a network interface on a node.

Examples

Example 1

Enabling DHCP for the IP Address and DNS on the adapter with alias 'Ethernet'.

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String[]]
        $NodeName = 'localhost'
    )

    Import-DscResource -Module NetworkingDsc

    Node $NodeName
    {
        DhcpClient EnableDhcpClient
        {
            State          = 'Enabled'
            InterfaceAlias = 'Ethernet'
            AddressFamily  = 'IPv4'
        }

        DnsServerAddress EnableDhcpDNS
        {
            InterfaceAlias = 'Ethernet'
            AddressFamily  = 'IPv4'
        }
    }
}