Skip to content

xDhcpServerAuthorization

dscbot edited this page Aug 18, 2023 · 2 revisions

xDhcpServerAuthorization

Parameters

Parameter Attribute DataType Description Allowed Values
IsSingleInstance Key String Specifies the resource is a single instance, the value must be 'Yes'. Yes
Ensure Required String Whether the DHCP server should be authorized within Active Directory Present, Absent
DnsName Write String DHCP Server FQDN
IPAddress Write String DHCP Server IP Address

Description

The xDhcpServerAuthorization DSC resource manages the authorization of a DHCP server in Active Directory.

Requirements

  • Target machine must be running Windows Server 2012 R2 or later.
  • Target machine must be running at minimum Windows PowerShell 5.0.

Examples

Example 1

This example will authorize the local DHCP server.

configuration Example
{
    Import-DscResource -ModuleName 'PSDscResources' -ModuleVersion '2.12.0.0'
    Import-DscResource -moduleName 'xDhcpServer'

    WindowsFeature 'DHCP'
    {
        Name   = 'DHCP'
        Ensure = 'Present'
    }

    xDhcpServerAuthorization 'LocalServerActivation'
    {
        IsSingleInstance = 'Yes'
        Ensure           = 'Present'
    }
}

Example 2

This example will authorize a remote DHCP server.

configuration Example
{
    Import-DscResource -moduleName 'xDhcpServer'

    xDhcpServerAuthorization 'RemoteServerActivation'
    {
        IsSingleInstance = 'Yes'
        Ensure           = 'Present'
        DnsName          = 'ServerToAuthorize.contoso.com'
        IPAddress        = '192.168.0.1'
    }
}