ADOptionalFeature - dsccommunity/ActiveDirectoryDsc GitHub Wiki
Parameters
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| FeatureName | Key | String | Specifies the feature to be activated | |
| ForestFQDN | Key | String | Specifies the target Active Directory forest for the change. | |
| EnterpriseAdministratorCredential | Required | PSCredential | Specifies the user account credentials to use to perform this task. | |
| Enabled | Read | Boolean | Shows the current state of the feature i.e. enabled or not |
Description
The ADOptionalFeature DSC resource will enable the Active Directory Optional Feature of choice for the target forest. This resource first verifies that the forest and domain modes match or exceed the requirements. If the forest or domain mode is insufficient, then the resource will exit with an error message. The change is executed against the Domain Naming Master FSMO of the forest.
Requirements
- Target machine must be running Windows Server 2008 R2 or later, depending on the feature.
Examples
Example 1
This configuration will enable the Active Directory Recycle Bin for a specified Domain
Configuration ADOptionalFeature_EnableADRecycleBin_Config
{
param
(
[Parameter(Mandatory = $true)]
[System.String]
$ForestFQDN,
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$EnterpriseAdministratorCredential
)
Import-DscResource -Module ActiveDirectoryDsc
Node localhost
{
ADOptionalFeature RecycleBin
{
FeatureName = "Recycle Bin Feature"
EnterpriseAdministratorCredential = $EnterpriseAdministratorCredential
ForestFQDN = $ForestFQDN
}
}
}