xactivedirectory
Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
- Puppet >= 6.0.0 < 8.0.0
Start using this module
Add this module to your Puppetfile:
mod 'dsc-xactivedirectory', '3.0.0-0-3'
Learn more about managing modules with a PuppetfileDocumentation
xactivedirectory
Table of Contents
Description
This is an auto-generated module, using the Puppet DSC Builder to vendor and expose the xactivedirectory PowerShell module's DSC resources as Puppet resources. The functionality of this module comes entirely from the vendored PowerShell resources, which are pinned at v3.0.0.0. The PowerShell module describes itself like this:
_The xActiveDirectory module is originally part of the Windows PowerShell Desired State Configuration (DSC) Resource Kit. This version has been modified for use in Azure. This module contains the xADDomain, xADDomainController, xADUser, and xWaitForDomain resources. These DSC Resources allow you to configure and manage Active Directory.
All of the resources in the DSC Resource Kit are provided AS IS, and are not supported through any Microsoft standard support program or service._
For information on troubleshooting to determine whether any encountered problems are with the Puppet wrapper or the DSC resource, see the troubleshooting section below.
Requirements
This module, like all auto-generated Puppetized DSC modules, relies on two important technologies in the Puppet stack: the Puppet Resource API and the puppetlabs/pwshlib Puppet module.
The Resource API provides a simplified option for writing types and providers and is responsible for how this module is structured. The Resource API ships inside of Puppet starting with version 6. While it is technically possible to add the Resource API functionality to Puppet 5.5.x, the DSC functionality has not been tested in this setup. For more information on the Resource API, review the documentation.
The module also depends on the pwshlib module. This Puppet module includes two important things: the ruby-pwsh library for running PowerShell code from ruby and the base provider for DSC resources, which this module leverages.
All of the actual work being done to call the DSC resources vendored with this module is in this file from the pwshlib module. This is important for troubleshooting and bug reporting, but doesn't impact your use of the module except that the end result will be that nothing works, as the dependency is not installed alongside this module!
Long File Path Support
Several PowerShell modules with DSC Resources end up with very long file paths once vendored, many of which exceed the 260 character limit for file paths. Luckily in Windows 10 (build 1607+), Windows Server 2016 (build 1607+), and Windows Server 2019 there is now an option for supporting long file paths transparently!
We strongly recommend enabling long file path support on any machines using this module to avoid path length issues.
You can set this value using the Puppet registry_value
resource:
registry_value { 'HKLM\System\CurrentControlSet\Control\FileSystem\LongPathsEnabled':
ensure => 'present',
data => [1],
provider => 'registry',
type => 'dword',
}
You can also set this value outside of Puppet by following the Microsoft documentation.
Usage
You can specify any of the DSC resources from this module like a normal Puppet resource in your manifests. The examples below use DSC resources from from the PowerShellGet repository, regardless of what module you're looking at here; the syntax, not the specifics, is what's important.
For reference documentation about the DSC resources exposed in this module, see the Reference Forge tab, or the REFERENCE.md file.
# Include a meaningful title for your resource declaration
dsc_psrepository { 'Add team module repo':
dsc_name => 'foo',
dsc_ensure => present,
# This location is nonsense, can be any valid folder on your
# machine or in a share, any location the SourceLocation param
# for the DSC resource will accept.
dsc_sourcelocation => 'C:\Program Files',
# You must always pass an enum fully lower-cased;
# Puppet is case sensitive even when PowerShell isn't
dsc_installationpolicy => untrusted,
}
dsc_psrepository { 'Trust public gallery':
dsc_name => 'PSGallery',
dsc_ensure => present,
dsc_installationpolicy => trusted,
}
dsc_psmodule { 'Make Ruby manageable via uru':
dsc_name => 'RubyInstaller',
dsc_ensure => present,
}
Credentials
Credentials are always specified as a hash of the username and password for the account. The password must use the Puppet Sensitive type; this ensures that logs and reports redact the password, displaying it instead as <Sensitive [value redacted]>.
dsc_psrepository { 'PowerShell Gallery':
dsc_name => 'psgAllery',
dsc_installationpolicy => 'Trusted',
dsc_psdscrunascredential => {
user => 'apple',
password => Sensitive('foobar'),
},
}
Class-Based Resources
Class-based DSC Resources can be used like any other DSC Resource in this module, with one important note:
Due to a bug in calling class-based DSC Resources by path instead of module name, each call to Invoke-DscResource
needs to temporarily munge the system-level environment variable for PSModulePath
;
the variable is reset prior to the end of each invocation.
CIM Instances
Because the CIM instances for DSC resources are fully mapped, the types actually explain fairly precisely what the shape of each CIM instance has to be - and, moreover, the type definition means that you get checking at catalog compile time. Puppet parses CIM instances are structured hashes (or arrays of structured hashes) that explicitly declare their keys and the valid types of values for each key.
So, for the dsc_accesscontrolentry
property of the dsc_ntfsaccessentry
type, which has a MOF type of NTFSAccessControlList[]
, Puppet defines the CIM instance as:
Array[Struct[{
accesscontrolentry => Array[Struct[{
accesscontroltype => Enum['Allow', 'Deny'],
inheritance => Enum['This folder only', 'This folder subfolders and files', 'This folder and subfolders', 'This folder and files', 'Subfolders and files only', 'Subfolders only', 'Files only'],
ensure => Enum['Present', 'Absent'],
cim_instance_type => 'NTFSAccessControlEntry',
filesystemrights => Array[Enum['AppendData', 'ChangePermissions', 'CreateDirectories', 'CreateFiles', 'Delete', 'DeleteSubdirectoriesAndFiles', 'ExecuteFile', 'FullControl', 'ListDirectory', 'Modify', 'Read', 'ReadAndExecute', 'ReadAttributes', 'ReadData', 'ReadExtendedAttributes', 'ReadPermissions', 'Synchronize', 'TakeOwnership', 'Traverse', 'Write', 'WriteAttributes', 'WriteData', 'WriteExtendedAttributes']]
}]],
forceprincipal => Optional[Boolean],
principal => Optional[String],
}]]
A valid example of that in a puppet manifest looks like this:
dsc_accesscontrollist => [
{
accesscontrolentry => [
{
accesscontroltype => 'Allow',
inheritance => 'This folder only',
ensure => 'Present',
filesystemrights => 'ChangePermissions',
cim_instance_type => 'NTFSAccessControlEntry',
},
],
principal => 'veryRealUserName',
},
]
For more information about using a built module, check out our narrative documentation.
Properties
Note that the only properties specified in a resource declaration which are passed to Invoke-Dsc are all prepended with dsc.
If a property does _not start with dsc_ it is used to control how Puppet interacts with DSC/other Puppet resources - for example,
specifying a unique name for the resource for Puppet to distinguish between declarations or Puppet metaparameters (notifies,
before, etc).
Validation Mode
By default, these resources use the property validation mode, which checks whether or not the resource is in the desired state the same way most Puppet resources are validated;
by comparing the properties returned from the system with those specified in the manifest.
Sometimes, however, this is insufficient;
many DSC Resources return data that does not compare properly to the desired state (some are missing properties, others are malformed, some simply cannot be strictly compared).
In these cases, you can set the validation mode to resource
, which falls back on calling Invoke-DscResource
with the Test
method and trusts that result.
When using the resource
validation mode, the resource is tested once and will then treat all properties of that resource as in sync (if the result returned true
) or not in sync.
This loses the granularity of change reporting for the resource but prevents flapping and unexpected behavior.
# This will flap because the DSC resource never returns name in SecurityPolicyDsc v2.10.0.0
dsc_securityoption { 'Enforce Anonoymous SID Translation':
dsc_name => 'Enforce Anonymous SID Translation',
dsc_network_access_allow_anonymous_sid_name_translation => 'Disabled',
}
# This will idempotently apply
dsc_psrepository { 'PowerShell Gallery':
validation_mode => 'resource',
dsc_name => 'Enforce Anonymous SID Translation',
dsc_network_access_allow_anonymous_sid_name_translation => 'Disabled',
}
It is important to note that this feature is only supported with a version of puppetlabs-pwshlib
equal to or higher than 0.9.0
, in which the supporting code for the DSC Base Provider to implement custom insync was shipped.
Finally, while this module's metadata says that the supported Puppet versions are 6.0.0 and up, the implementation of the validation_mode
parameter relies on the custom_insync
feature of the Puppet Resource API.
The custom_insync
feature first shipped in the puppet-resource_api
version 1.8.14
, which itself is only included in Puppet versions equal to or newer than 6.23.0
and 7.8.0
for the 6x and 7x platforms respectively.
Using this module against older Puppet versions will result in a warning (example below) and only use the default property-by-property change reporting, regardless of the setting of validation_mode
.
Warning: Unknown feature detected: ["custom_insync"]
Troubleshooting
In general, there are three broad categories of problems:
- Problems with the way the underlying DSC resource works.
- Problems with the type definition, where you can't specify a valid set of properties for the DSC resource
- Problems with calling the underlying DSC resource - the parameters aren't being passed correctly or the resource can't be found
Unfortunately, problems with the way the underlying DSC resource works are something we can't help directly with. You'll need to file an issue with the upstream maintainers for the PowerShell module.
Problems with the type definition are when a value that should be valid according to the DSC resource's documentation and code is not accepted by the Puppet wrapper. If and when you run across one of these, please file an issue with the Puppet DSC Builder; this is where the conversion happens and once we know of a problem we can fix it and regenerate the Puppet modules. To help us identify the issue, please specify the DSC module, version, resource, property and values that are giving you issues. Once a fix is available we will regenerate and release updated versions of this Puppet wrapper.
Problems with calling the underlying DSC resource become apparent by comparing <value passed in in puppet>
with <value received by DSC>
.
In this case, please file an issue with the puppetlabs/pwshlib module, which is where the DSC base provider actually lives.
We'll investigate and prioritize a fix and update the puppetlabs/pwshlib module.
Updating to the pwshlib version with the fix will immediately take advantage of the improved functionality without waiting for this module to be reconverted and published.
For specific information on troubleshooting a generated module, check the troubleshooting guide for the puppet.dsc module.
Known Limitations
Currently, because of the way Puppet caches files on agents, use of the legacy puppetlabs-dsc
module is not compatible with this or any auto-generated DSC module.
Inclusion of both will lead to pluginsync conflicts.
Right now, if you have the same version of a PowerShell module with class-based DSC Resources in your PSModulePath as vendored in a Puppetized DSC Module, you cannot use those class-based DSC Resources from inside of Puppet due to a bug in DSC which prevents using a module by path reference instead of name. Instead, DSC will see that there are two DSC Resources for the same module and version and then error out.
Configuring the LCM
In order for a Puppetized DSC module to function, the DSC Local Configuration Manager (LCM) RefreshMode
must be set to either Push
or Disabled
.
The default value for RefreshMode
in WMF 5.0 and WMF 5.1 is Push
- so if it has not been set to anything else then there is no action needed on your part.
However if the value of the LCM has been set to anything other than Push
then the module will not function and so the value must either be changed back or disabled.
The Puppetized DSC modules use the Invoke-DscResource
cmdlet to invoke DSC Resources of the target machine.
If the RefreshMode
is set to Pull
, DSC Resources will only run from a DSC Pull Server - in this setting DSC does not allow any DSC Resources to be run interactively on the host.
Module Installation
If you're using this module with Puppet Enterprise and Code Manager, everything should "just work" - no errors or issues acquiring and deploying this or any Puppetized DSC module to nodes.
Unfortunately, due a bug in minitar which prevents it from unpacking archives with long file paths, both r10k
and serverless Puppet (via puppet module install
) methods of installing modules with long path names will fail.
In short, minitar is unable to unpack modules that contain long file paths (though it can create them).
As a workaround, you can retrieve DSC modules from the forge via PowerShell and 7zip:
$ModuleAuthor = 'dsc'
$ModuleName = 'xremotedesktopsessionhost'
$ModuleVersion = '2.0.0-0-1'
$ArchiveFileName = "$ModuleAuthor-$ModuleName-$ModuleVersion.tar.gz"
$DownloadUri = "https://forge.puppet.com/v3/files/$ArchiveFileName"
# Download the module tar.gz to the current directory
Invoke-WebRequest -Uri $DownloadUri -OutFile ./$ArchiveFileName
# Use 7zip to extract the module to the current directory
& 7z x $ArchiveFileName -so | & 7z x -aoa -si -ttar
Reference
Table of Contents
Resource types
dsc_xadcomputer
: The DSC xADComputer resource type. Automatically generated from version 3.0.0.0dsc_xaddomain
: The DSC xADDomain resource type. Automatically generated from version 3.0.0.0dsc_xaddomaincontroller
: The DSC xADDomainController resource type. Automatically generated from version 3.0.0.0dsc_xaddomaindefaultpasswordpolicy
: The DSC xADDomainDefaultPasswordPolicy resource type. Automatically generated from version 3.0.0.0dsc_xaddomaintrust
: The DSC xADDomainTrust resource type. Automatically generated from version 3.0.0.0dsc_xadforestproperties
: The DSC xADForestProperties resource type. Automatically generated from version 3.0.0.0dsc_xadgroup
: The DSC xADGroup resource type. Automatically generated from version 3.0.0.0dsc_xadkdskey
: The DSC xADKDSKey resource type. Automatically generated from version 3.0.0.0dsc_xadmanagedserviceaccount
: The DSC xADManagedServiceAccount resource type. Automatically generated from version 3.0.0.0dsc_xadobjectenabledstate
: The DSC xADObjectEnabledState resource type. Automatically generated from version 3.0.0.0dsc_xadobjectpermissionentry
: The DSC xADObjectPermissionEntry resource type. Automatically generated from version 3.0.0.0dsc_xadorganizationalunit
: The DSC xADOrganizationalUnit resource type. Automatically generated from version 3.0.0.0dsc_xadrecyclebin
: The DSC xADRecycleBin resource type. Automatically generated from version 3.0.0.0dsc_xadreplicationsite
: The DSC xADReplicationSite resource type. Automatically generated from version 3.0.0.0dsc_xadreplicationsitelink
: The DSC xADReplicationSiteLink resource type. Automatically generated from version 3.0.0.0dsc_xadreplicationsubnet
: The DSC xADReplicationSubnet resource type. Automatically generated from version 3.0.0.0dsc_xadserviceprincipalname
: The DSC xADServicePrincipalName resource type. Automatically generated from version 3.0.0.0dsc_xaduser
: The DSC xADUser resource type. Automatically generated from version 3.0.0.0dsc_xwaitforaddomain
: The DSC xWaitForADDomain resource type. Automatically generated from version 3.0.0.0
Resource types
dsc_xadcomputer
The DSC xADComputer resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadcomputer
type.
dsc_description
Data type: Optional[String]
Specifies a description of the computer account.
dsc_displayname
Data type: Optional[String]
Specifies the display name of the computer account.
dsc_distinguishedname
Data type: Optional[String]
Returns the X.500 path of the computer object
dsc_dnshostname
Data type: Optional[String]
Specifies the fully qualified domain name (FQDN) of the computer account.
dsc_domaincontroller
Data type: Optional[String]
Specifies the Active Directory Domain Services instance to connect to perform the task.
dsc_enabled
Data type: Optional[Boolean]
DEPRECATED - DO NOT USE. Please see the parameter EnabledOnCreation in this resource, and the resource xADObjectEnabledState on how to enforce the Enabled property. This parameter no longer sets or enforces the Enabled property. If this parameter is used then a warning message will be outputted saying that the Enabled parameter has been deprecated.
dsc_enabledoncreation
Data type: Optional[Boolean]
Specifies if the computer account is created enabled or disabled. By default the Enabled property of the computer account will be set to the default value of the cmdlet New-ADComputer. This property is ignored if the parameter RequestFile is specified in the same configuration. This parameter does not enforce the property Enabled. To enforce the property Enabled see the resource xADObjectEnabledState.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies whether the computer account is present or absent. Valid values are 'Present' and 'Absent'. The default is 'Present'.
dsc_location
Data type: Optional[String]
Specifies the location of the computer, such as an office number.
dsc_manager
Data type: Optional[String]
Specifies the user or group Distinguished Name that manages the computer account. Valid values are the user's or group's DistinguishedName, ObjectGUID, SID or SamAccountName.
dsc_path
Data type: Optional[String]
Specifies the X.500 path of the Organizational Unit (OU) or container where the computer is located.
dsc_requestfile
Data type: Optional[String]
Specifies the full path to the Offline Domain Join Request file to create.
dsc_restorefromrecyclebin
Data type: Optional[Boolean]
Try to restore the computer account from the recycle bin before creating a new one.
dsc_samaccountname
Data type: Optional[String]
Returns the security identifier of the computer object
dsc_serviceprincipalnames
Data type: Optional[Array[String]]
Specifies the service principal names for the computer account.
dsc_sid
Data type: Optional[String]
Returns the security identifier of the computer object
dsc_userprincipalname
Data type: Optional[String]
Specifies the UPN assigned to the computer account.
Parameters
The following parameters are available in the dsc_xadcomputer
type.
dsc_computername
namevar
Data type: String
Specifies the name of the Active Directory computer account to manage. You can identify a computer by its distinguished name, GUID, security identifier (SID) or Security Accounts Manager (SAM) account name.
dsc_domainadministratorcredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Specifies the user account credentials to use to perform the task.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xaddomain
The DSC xADDomain resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xaddomain
type.
dsc_databasepath
Data type: Optional[String]
Path to a directory that contains the domain database
dsc_domainmode
Data type: Optional[Enum['Win2008', 'Win2008R2', 'Win2012', 'Win2012R2', 'WinThreshold']]
The Domain Functional Level for the entire domain
dsc_domainnetbiosname
Data type: Optional[String]
NetBIOS name for the new domain
dsc_forestmode
Data type: Optional[Enum['Win2008', 'Win2008R2', 'Win2012', 'Win2012R2', 'WinThreshold']]
The Forest Functional Level for the entire forest
dsc_logpath
Data type: Optional[String]
Path to a directory for the log file that will be written
dsc_parentdomainname
Data type: Optional[String]
Fully qualified name of the parent domain
dsc_sysvolpath
Data type: Optional[String]
Path to a directory where the Sysvol file will be written
Parameters
The following parameters are available in the dsc_xaddomain
type.
dsc_dnsdelegationcredential
dsc_domainadministratorcredential
dsc_domainname
dsc_psdscrunascredential
dsc_safemodeadministratorpassword
name
validation_mode
dsc_dnsdelegationcredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Credential used for creating DNS delegation
dsc_domainadministratorcredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Credentials used to query for domain existence
dsc_domainname
namevar
Data type: String
FQDN of the new domain
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_safemodeadministratorpassword
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Password for the administrator account when the computer is started in Safe Mode
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xaddomaincontroller
The DSC xADDomainController resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xaddomaincontroller
type.
dsc_databasepath
Data type: Optional[String]
The path where the database will be stored.
dsc_ensure
Data type: Optional[String]
The state of the Domain Controller.
dsc_installationmediapath
Data type: Optional[String]
The path of the media you want to use install the Domain Controller.
dsc_isglobalcatalog
Data type: Optional[Boolean]
Specifies if the domain controller will be a Global Catalog (GC).
dsc_logpath
Data type: Optional[String]
The path where the logs will be stored.
dsc_sitename
Data type: Optional[String]
The name of the site this Domain Controller will be added to.
dsc_sysvolpath
Data type: Optional[String]
The path where the Sysvol will be stored.
Parameters
The following parameters are available in the dsc_xaddomaincontroller
type.
dsc_domainadministratorcredential
dsc_domainname
dsc_psdscrunascredential
dsc_safemodeadministratorpassword
name
validation_mode
dsc_domainadministratorcredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The 'PSCredential' object containing Domain Administrator rights to add the Domain Controller to the domain.
dsc_domainname
namevar
Data type: String
The FQDN of the domain the Domain Controller will be joining.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_safemodeadministratorpassword
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The 'PSCredential' object containing the password to use for DSRM.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xaddomaindefaultpasswordpolicy
The DSC xADDomainDefaultPasswordPolicy resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xaddomaindefaultpasswordpolicy
type.
dsc_complexityenabled
Data type: Optional[Boolean]
Whether password complexity is enabled for the default password policy
dsc_domaincontroller
Data type: Optional[String]
Active Directory domain controller to enact the change upon
dsc_lockoutduration
Data type: Optional[Integer[0, 4294967295]]
Length of time that an account is locked after the number of failed login attempts (minutes)
dsc_lockoutobservationwindow
Data type: Optional[Integer[0, 4294967295]]
Maximum time between two unsuccessful login attempts before the counter is reset to 0 (minutes)
dsc_lockoutthreshold
Data type: Optional[Integer[0, 4294967295]]
Number of unsuccessful login attempts that are permitted before an account is locked out
dsc_maxpasswordage
Data type: Optional[Integer[0, 4294967295]]
Maximum length of time that you can have the same password (minutes)
dsc_minpasswordage
Data type: Optional[Integer[0, 4294967295]]
Minimum length of time that you can have the same password (minutes)
dsc_minpasswordlength
Data type: Optional[Integer[0, 4294967295]]
Minimum number of characters that a password must contain
dsc_passwordhistorycount
Data type: Optional[Integer[0, 4294967295]]
Number of previous passwords to remember
dsc_reversibleencryptionenabled
Data type: Optional[Boolean]
Whether the directory must store passwords using reversible encryption
Parameters
The following parameters are available in the dsc_xaddomaindefaultpasswordpolicy
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Credentials used to access the domain
dsc_domainname
namevar
Data type: String
Name of the domain to which the password policy will be applied
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xaddomaintrust
The DSC xADDomainTrust resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xaddomaintrust
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Should this resource be present or absent
dsc_trustdirection
Data type: Enum['Bidirectional', 'Inbound', 'Outbound']
Direction of trust
dsc_trusttype
Data type: Enum['External', 'Forest']
Type of trust
Parameters
The following parameters are available in the dsc_xaddomaintrust
type.
dsc_psdscrunascredential
dsc_sourcedomainname
dsc_targetdomainadministratorcredential
dsc_targetdomainname
name
validation_mode
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_sourcedomainname
namevar
Data type: String
Name of the AD domain that is requesting the trust
dsc_targetdomainadministratorcredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Credentials to authenticate to the target domain
dsc_targetdomainname
namevar
Data type: String
Name of the AD domain that is being trusted
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadforestproperties
The DSC xADForestProperties resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadforestproperties
type.
dsc_serviceprincipalnamesuffix
Data type: Optional[Array[String]]
Specifies the Service Principal Name (SPN) Suffix(es) to be explicitly defined in the forest and replace existing SPNs. Cannot be used with ServicePrincipalNameSuffixToAdd or ServicePrincipalNameSuffixToRemove.
dsc_serviceprincipalnamesuffixtoadd
Data type: Optional[Array[String]]
Specifies the Service Principal Name (SPN) Suffix(es) to be added to the forest. Cannot be used with ServicePrincipalNameSuffix.
dsc_serviceprincipalnamesuffixtoremove
Data type: Optional[Array[String]]
Specifies the Service Principal Name (SPN) Suffix(es) to be removed from the forest. Cannot be used with ServicePrincipalNameSuffix.
dsc_userprincipalnamesuffix
Data type: Optional[Array[String]]
Specifies the User Principal Name (UPN) Suffix(es) to be explicitly defined in the forest and replace existing UPNs. Cannot be used with UserPrincipalNameSuffixToAdd or UserPrincipalNameSuffixToRemove.
dsc_userprincipalnamesuffixtoadd
Data type: Optional[Array[String]]
Specifies the User Principal Name (UPN) Suffix(es) to be added to the forest. Cannot be used with UserPrincipalNameSuffix.
dsc_userprincipalnamesuffixtoremove
Data type: Optional[Array[String]]
Specifies the User Principal Name (UPN) Suffix(es) to be removed from the forest. Cannot be used with UserPrincipalNameSuffix.
Parameters
The following parameters are available in the dsc_xadforestproperties
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Specifies the user account credentials to use to perform this task.
dsc_forestname
namevar
Data type: String
Specifies the target Active Directory forest for the change.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadgroup
The DSC xADGroup resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadgroup
type.
dsc_category
Data type: Optional[Enum['Security', 'Distribution']]
Active Directory group category
dsc_description
Data type: Optional[String]
Description of the Active Directory group
dsc_displayname
Data type: Optional[String]
Display name of the Active Directory group
dsc_domaincontroller
Data type: Optional[String]
Active Directory domain controller to enact the change upon
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Should this resource be present or absent
dsc_groupscope
Data type: Optional[Enum['DomainLocal', 'Global', 'Universal']]
Active Directory group scope
dsc_managedby
Data type: Optional[String]
Active Directory managed by attribute specified as a DistinguishedName
dsc_members
Data type: Optional[Array[String]]
Active Directory group membership should match membership exactly
dsc_membershipattribute
Data type: Optional[Enum['SamAccountName', 'DistinguishedName', 'ObjectGUID', 'SID']]
Active Directory attribute used to perform membership operations
dsc_memberstoexclude
Data type: Optional[Array[String]]
Active Directory group should NOT include these members
dsc_memberstoinclude
Data type: Optional[Array[String]]
Active Directory group should include these members
dsc_notes
Data type: Optional[String]
Active Directory group notes field
dsc_path
Data type: Optional[String]
Location of the group within Active Directory expressed as a Distinguished Name
dsc_restorefromrecyclebin
Data type: Optional[Boolean]
Try to restore the group from the recycle bin before creating a new one.
Parameters
The following parameters are available in the dsc_xadgroup
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Credentials used to enact the change upon
dsc_groupname
namevar
Data type: String
Name of the Active Directory group
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadkdskey
The DSC xADKDSKey resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadkdskey
type.
dsc_allowunsafeeffectivetime
Data type: Optional[Boolean]
This option will allow you to create a KDS root key if EffectiveTime is set in the past. This may cause issues if you are creating a Group Managed Service Account right after you create the KDS Root Key. In order to get around this, you must create the KDS Root Key using a date in the past. This should be used at your own risk and should only be used in lab environments.
dsc_creationtime
Data type: Optional[Timestamp]
Specifies the Creation date and time of the KDS root key for informational purposes
dsc_distinguishedname
Data type: Optional[String]
Specifies the Distinguished Name (DN) of the KDS root key. The KDS Root Key is stored in 'CN=Master Root Keys,CN=Group Key Distribution Service,CN=Services,CN=Configuration' at the Forest level. This is also why replication needs 10 hours to occur before using the KDS Root Key as a safey measure.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies if this KDS Root Key should be present or absent
dsc_forceremove
Data type: Optional[Boolean]
This option will allow you to remove a KDS root key if there is only one key left. It should not break your Group Managed Service Accounts (gMSAs), but if the gMSA password expires and it needs to request a new password, it will not be able to generate a new password until a new KDS Root Key is installed and ready for use. Because of this, the last KDS Root Key will not be removed unless this option is specified
dsc_keyid
Data type: Optional[String]
Specifies the KeyID of the KDS root key. This is the Common Name (CN) within Active Directory and is required to build the Distinguished Name
Parameters
The following parameters are available in the dsc_xadkdskey
type.
dsc_effectivetime
namevar
Data type: String
Specifies the Effective time when a KDS root key can be used. There is a 10 hour minimum from creation date to allow active directory to properly replicate across all domain controllers. For this reason, the date must be set in the future for creation. While this parameter accepts a string, it will be converted into a DateTime object. This will also try to take into account cultural settings. Example: '05/01/1999 13:00 using default or 'en-US' culture would be May 1st, but using 'de-DE' culture would be 5th of January. The culture is automatically pulled from the operating system and this can be checked using 'Get-Culture'
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadmanagedserviceaccount
The DSC xADManagedServiceAccount resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadmanagedserviceaccount
type.
dsc_accounttype
Data type: Optional[Enum['Group', 'Single']]
The type of managed service account. Single will create a Single Managed Service Account (sMSA) and Group will create a Group Managed Service Account (gMSA). If not specified, this vaule defaults to Single.
dsc_accounttypeforce
Data type: Optional[Boolean]
Specifies whether or not to remove the service account and recreate it when going from single MSA to group MSA and vice-versa. If not specified, this value defaults to False.
dsc_description
Data type: Optional[String]
Specifies a description of the object (ldapDisplayName 'description')
dsc_displayname
Data type: Optional[String]
Specifies the display name of the object (ldapDisplayName 'displayName')
dsc_distinguishedname
Data type: Optional[String]
Specifies the Distinguished Name of the Service Account. Cannot be specified in the resource. Returned by Get and Compare.
dsc_domaincontroller
Data type: Optional[String]
Specifies the Active Directory Domain Controller instance to use to perform the task. This is only required if not executing the task on a domain controller.
dsc_enabled
Data type: Optional[Boolean]
Specifies whether the user account is enabled or disabled.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies whether the user account is created or deleted. If not specified, this value defaults to Present.
dsc_members
Data type: Optional[Array[String]]
Specifies the members of the object (ldapDisplayName 'PrincipalsAllowedToRetrieveManagedPassword'). Only used when 'Group' is selected for 'AccountType'
dsc_membershipattribute
Data type: Optional[Enum['SamAccountName', 'DistinguishedName', 'ObjectGUID', 'SID']]
Active Directory attribute used to perform membership operations for Group Managed Service Accounts (gMSAs). If not specified, this value defaults to SamAccountName. Only used when 'Group' is selected for 'AccountType'
dsc_path
Data type: Optional[String]
Specifies the X.500 path of the Organizational Unit (OU) or container where the new object is created. Specified as a Distinguished Name (DN).
Parameters
The following parameters are available in the dsc_xadmanagedserviceaccount
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Specifies the user account credentials to use to perform this task. This is only required if not executing the task on a domain controller or using the -DomainController parameter.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_serviceaccountname
namevar
Data type: String
Specifies the Security Account Manager (SAM) account name of the managed service account (ldapDisplayName 'sAMAccountName'). To be compatible with older operating systems, create a SAM account name that is 20 characters or less. Once created, the user's SamAccountName and CN cannot be changed.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadobjectenabledstate
The DSC xADObjectEnabledState resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadobjectenabledstate
type.
dsc_domaincontroller
Data type: Optional[String]
Specifies the Active Directory Domain Services instance to connect to perform the task.
dsc_enabled
Data type: Boolean
Specifies the value of the Enabled property.
Parameters
The following parameters are available in the dsc_xadobjectenabledstate
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Specifies the user account credentials to use to perform the task.
dsc_identity
namevar
Data type: String
Specifies the identity of an object that has the object class specified in the parameter ObjectClass. When ObjectClass is set to 'Computer' then this property can be set to either distinguished name, GUID (objectGUID), security identifier (objectSid), or security Accounts Manager account name (sAMAccountName).
dsc_objectclass
namevar
Data type: Enum['Computer']
Specifies the object class.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadobjectpermissionentry
The DSC xADObjectPermissionEntry resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadobjectpermissionentry
type.
dsc_activedirectoryrights
Data type: Optional[Array[Enum['AccessSystemSecurity', 'CreateChild', 'Delete', 'DeleteChild', 'DeleteTree', 'ExtendedRight', 'GenericAll', 'GenericExecute', 'GenericRead', 'GenericWrite', 'ListChildren', 'ListObject', 'ReadControl', 'ReadProperty', 'Self', 'Synchronize', 'WriteDacl', 'WriteOwner', 'WriteProperty']]]
A combination of one or more of the ActiveDirectoryRights enumeration values that specifies the rights of the access rule. Default is 'GenericAll'.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Indicates if the access will be added (Present) or will be removed (Absent). Default is 'Present'.
Parameters
The following parameters are available in the dsc_xadobjectpermissionentry
type.
dsc_accesscontroltype
dsc_activedirectorysecurityinheritance
dsc_identityreference
dsc_inheritedobjecttype
dsc_objecttype
dsc_path
dsc_psdscrunascredential
name
validation_mode
dsc_accesscontroltype
namevar
Data type: Enum['Allow', 'Deny']
Indicates whether to Allow or Deny access to the target object.
dsc_activedirectorysecurityinheritance
namevar
Data type: Enum['All', 'Children', 'Descendents', 'None', 'SelfAndChildren']
One of the 'ActiveDirectorySecurityInheritance' enumeration values that specifies the inheritance type of the access rule.
dsc_identityreference
namevar
Data type: String
Indicates the identity of the principal for the ACE. Use the notation DOMAIN\SamAccountName for the identity.
dsc_inheritedobjecttype
namevar
Data type: String
The schema GUID of the child object type that can inherit this access rule. If the permission entry shouldn't be restricted to a specific inherited object type, use the zero guid: 00000000-0000-0000-0000-000000000000.
dsc_objecttype
namevar
Data type: String
The schema GUID of the object to which the access rule applies. If the permission entry shouldn't be restricted to a specific object type, use the zero guid: 00000000-0000-0000-0000-000000000000.
dsc_path
namevar
Data type: String
Active Directory path of the target object to add or remove the permission entry, specified as a Distinguished Name.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadorganizationalunit
The DSC xADOrganizationalUnit resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadorganizationalunit
type.
dsc_description
Data type: Optional[String]
The description of the OU
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
dsc_protectedfromaccidentaldeletion
Data type: Optional[Boolean]
Defaults to True
dsc_restorefromrecyclebin
Data type: Optional[Boolean]
Try to restore the organizational unit from the recycle bin before creating a new one.
Parameters
The following parameters are available in the dsc_xadorganizationalunit
type.
dsc_credential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The credential to be used to perform the operation on Active Directory
dsc_name
namevar
Data type: String
The name of OU
dsc_path
namevar
Data type: String
Specifies the X500 path of the OU or container where the new object is created
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadrecyclebin
The DSC xADRecycleBin resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadrecyclebin
type.
dsc_forestmode
Data type: Optional[String]
The functional level of the forest.
dsc_recyclebinenabled
Data type: Optional[String]
The state of the Recycle Bin feature.
Parameters
The following parameters are available in the dsc_xadrecyclebin
type.
dsc_enterpriseadministratorcredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The user account credentials to use to perform this task.
dsc_forestfqdn
namevar
Data type: String
The FQDN of the forest in which to change the Recycle Bin feature.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadreplicationsite
The DSC xADReplicationSite resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadreplicationsite
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies if the AD replication site should be added or remove. Default value is 'Present'. { Present | Absent }.
dsc_renamedefaultfirstsitename
Data type: Optional[Boolean]
Specify if the Default-First-Site-Name should be renamed, if it exists. Dafult value is 'false'.
Parameters
The following parameters are available in the dsc_xadreplicationsite
type.
dsc_name
namevar
Data type: String
Specifies the name of the AD replication site.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadreplicationsitelink
The DSC xADReplicationSiteLink resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadreplicationsitelink
type.
dsc_cost
Data type: Optional[Integer[-2147483648, 2147483647]]
Specifies the cost to be placed on the site link
dsc_description
Data type: Optional[String]
This parameter sets the value of the Description property for the object
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies if the site link is created or deleted
dsc_replicationfrequencyinminutes
Data type: Optional[Integer[-2147483648, 2147483647]]
Species the frequency (in minutes) for which replication will occur where this site link is in use between sites
dsc_sitesexcluded
Data type: Optional[Array[String]]
Specifies the list of sites to exclude from the site link
dsc_sitesincluded
Data type: Optional[Array[String]]
Specifies the list of sites included in the site link
Parameters
The following parameters are available in the dsc_xadreplicationsitelink
type.
dsc_name
namevar
Data type: String
Specifies the name of the site link
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadreplicationsubnet
The DSC xADReplicationSubnet resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadreplicationsubnet
type.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies if the AD replication subnet should be added or remove. Default value is 'Present'.
dsc_location
Data type: Optional[String]
The location for the AD replication site. Default value is empty.
dsc_site
Data type: String
The name of the assigned AD replication site, e.g. Default-First-Site-Name.
Parameters
The following parameters are available in the dsc_xadreplicationsubnet
type.
dsc_name
namevar
Data type: String
The name of the AD replication subnet, e.g. 10.0.0.0/24.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xadserviceprincipalname
The DSC xADServicePrincipalName resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xadserviceprincipalname
type.
dsc_account
Data type: Optional[String]
The user or computer account to add or remove the SPN, e.b. User1 or LON-DC1$. Default value is ''. If Ensure is set to Present, a value must be specified.
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies if the service principal name should be added or remove. Default value is 'Present'.
Parameters
The following parameters are available in the dsc_xadserviceprincipalname
type.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_serviceprincipalname
namevar
Data type: String
The full SPN to add or remove, e.g. HOST/LON-DC1.
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xaduser
The DSC xADUser resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xaduser
type.
dsc_accountnotdelegated
Data type: Optional[Boolean]
Indicates whether the security context of the user is delegated to a service. When this parameter is set to true, the security context of the account is not delegated to a service even when the service account is set as trusted for Kerberos delegation. This parameter sets the AccountNotDelegated property for an Active Directory account. This parameter also sets the ADS_UF_NOT_DELEGATED flag of the Active Directory User Account Control (UAC) attribute.
dsc_allowreversiblepasswordencryption
Data type: Optional[Boolean]
Indicates whether reversible password encryption is allowed for the account. This parameter sets the AllowReversiblePasswordEncryption property of the account. This parameter also sets the ADS_UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED flag of the Active Directory User Account Control (UAC) attribute.
dsc_cannotchangepassword
Data type: Optional[Boolean]
Specifies whether the account password can be changed
dsc_changepasswordatlogon
Data type: Optional[Boolean]
Specifies whether the account password must be changed during the next logon attempt. This cannot be set to true if the PasswordNeverExpires property is also set to true
dsc_city
Data type: Optional[String]
Specifies the user's town or city (ldapDisplayName 'l')
dsc_commonname
Data type: Optional[String]
Specifies the common nane assigned to the user account (ldapDisplayName 'cn')
dsc_company
Data type: Optional[String]
Specifies the user's company (ldapDisplayName 'company')
dsc_compoundidentitysupported
Data type: Optional[Boolean]
Specifies whether an account supports Kerberos service tickets which includes the authorization data for the user's device. This value sets the compound identity supported flag of the Active Directory msDS-SupportedEncryptionTypes attribute.
dsc_country
Data type: Optional[String]
Specifies the country or region code for the user's language of choice (ldapDisplayName 'c')
dsc_department
Data type: Optional[String]
Specifies the user's department (ldapDisplayName 'department')
dsc_description
Data type: Optional[String]
Specifies a description of the object (ldapDisplayName 'description')
dsc_displayname
Data type: Optional[String]
Specifies the display name of the object (ldapDisplayName 'displayName')
dsc_distinguishedname
Data type: Optional[String]
Returns the X.500 path of the object
dsc_division
Data type: Optional[String]
Specifies the user's division (ldapDisplayName 'division')
dsc_domaincontroller
Data type: Optional[String]
Specifies the Active Directory Domain Services instance to use to perform the task.
dsc_emailaddress
Data type: Optional[String]
Specifies the user's e-mail address (ldapDisplayName 'mail')
dsc_employeeid
Data type: Optional[String]
Specifies the user's employee ID (ldapDisplayName 'employeeID')
dsc_employeenumber
Data type: Optional[String]
Specifies the user's employee number (ldapDisplayName 'employeeNumber')
dsc_enabled
Data type: Optional[Boolean]
Specifies if the account is enabled (default True)
dsc_ensure
Data type: Optional[Enum['Present', 'Absent']]
Specifies whether the user account is created or deleted
dsc_fax
Data type: Optional[String]
Specifies the user's fax phone number (ldapDisplayName 'facsimileTelephoneNumber')
dsc_givenname
Data type: Optional[String]
Specifies the user's given name (ldapDisplayName 'givenName')
dsc_homedirectory
Data type: Optional[String]
Specifies a user's home directory path (ldapDisplayName 'homeDirectory')
dsc_homedrive
Data type: Optional[String]
Specifies a drive that is associated with the UNC path defined by the HomeDirectory property (ldapDisplayName 'homeDrive')
dsc_homepage
Data type: Optional[String]
Specifies the URL of the home page of the object (ldapDisplayName 'wWWHomePage')
dsc_homephone
Data type: Optional[String]
Specifies the user's home telephone number (ldapDisplayName 'homePhone')
dsc_initials
Data type: Optional[String]
Specifies the initials that represent part of a user's name (ldapDisplayName 'initials')
dsc_ipphone
Data type: Optional[String]
Specifies the user's IP telephony phone number (ldapDisplayName 'ipPhone')
dsc_jobtitle
Data type: Optional[String]
Specifies the user's title (ldapDisplayName 'title')
dsc_logonscript
Data type: Optional[String]
Specifies a path to the user's log on script (ldapDisplayName 'scriptPath')
dsc_logonworkstations
Data type: Optional[String]
Specifies the computers that the user can access. To specify more than one computer, create a single comma-separated list. You can identify a computer by using the Security Account Manager (SAM) account name (sAMAccountName) or the DNS host name of the computer. The SAM account name is the same as the NetBIOS name of the computer. The LDAP display name (ldapDisplayName) for this property is userWorkStations.
dsc_manager
Data type: Optional[String]
Specifies the user's manager specified as a Distinguished Name (ldapDisplayName 'manager')
dsc_mobilephone
Data type: Optional[String]
Specifies the user's mobile phone number (ldapDisplayName 'mobile')
dsc_notes
Data type: Optional[String]
Specifies the notes attached to the user's accoutn (ldapDisplayName 'info')
dsc_office
Data type: Optional[String]
Specifies the location of the user's office or place of business (ldapDisplayName 'physicalDeliveryOfficeName')
dsc_officephone
Data type: Optional[String]
Specifies the user's office telephone number (ldapDisplayName 'telephoneNumber')
dsc_organization
Data type: Optional[String]
Specifies the user's organization. This parameter sets the Organization property of a user object. The LDAP display name (ldapDisplayName) of this property is o.
dsc_othername
Data type: Optional[String]
Specifies a name in addition to a user's given name and surname, such as the user's middle name. This parameter sets the OtherName property of a user object. The LDAP display name (ldapDisplayName) of this property is middleName.
dsc_pager
Data type: Optional[String]
Specifies the user's pager number (ldapDisplayName 'pager')
dsc_passwordauthentication
Data type: Optional[Enum['Default', 'Negotiate']]
Specifies the authentication context type used when testing passwords
dsc_passwordneverexpires
Data type: Optional[Boolean]
Specifies whether the password of an account can expire
dsc_passwordneverresets
Data type: Optional[Boolean]
Specifies whether existing user's password should be reset (default $false)
dsc_passwordnotrequired
Data type: Optional[Boolean]
Specifies whether the account requires a password. A password is not required for a new account. This parameter sets the PasswordNotRequired property of an account object.
dsc_path
Data type: Optional[String]
Specifies the X.500 path of the Organizational Unit (OU) or container where the new object is created
dsc_pobox
Data type: Optional[String]
Specifies the user's post office box number (ldapDisplayName 'postOfficeBox')
dsc_postalcode
Data type: Optional[String]
Specifies the user's postal code or zip code (ldapDisplayName 'postalCode')
dsc_profilepath
Data type: Optional[String]
Specifies a path to the user's profile (ldapDisplayName 'profilePath')
dsc_proxyaddresses
Data type: Optional[Array[String]]
Specifies the proxy addresses for the user account.
dsc_restorefromrecyclebin
Data type: Optional[Boolean]
Try to restore the user object from the recycle bin before creating a new one.
dsc_serviceprincipalnames
Data type: Optional[Array[String]]
Specifies the service principal names for the user account.
dsc_smartcardlogonrequired
Data type: Optional[Boolean]
Specifies whether a smart card is required to logon. This parameter sets the SmartCardLoginRequired property for a user object. This parameter also sets the ADS_UF_SMARTCARD_REQUIRED flag of the Active Directory User Account Control attribute.
dsc_state
Data type: Optional[String]
Specifies the user's or Organizational Unit's state or province (ldapDisplayName 'st')
dsc_streetaddress
Data type: Optional[String]
Specifies the user's street address (ldapDisplayName 'streetAddress')
dsc_surname
Data type: Optional[String]
Specifies the user's last name or surname (ldapDisplayName 'sn')
dsc_trustedfordelegation
Data type: Optional[Boolean]
Specifies whether an account is trusted for Kerberos delegation (default $false)
dsc_userprincipalname
Data type: Optional[String]
Specifies the UPN assigned to the user account (ldapDisplayName 'userPrincipalName')
Parameters
The following parameters are available in the dsc_xaduser
type.
dsc_domainadministratorcredential
dsc_domainname
dsc_password
dsc_psdscrunascredential
dsc_username
name
validation_mode
dsc_domainadministratorcredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Specifies the user account credentials to use to perform this task
dsc_domainname
namevar
Data type: String
Name of the domain where the user account is located (only used if password is managed)
dsc_password
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
Specifies a new password value for the account
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
dsc_username
namevar
Data type: String
Specifies the Security Account Manager (SAM) account name of the user (ldapDisplayName 'sAMAccountName')
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
dsc_xwaitforaddomain
The DSC xWaitForADDomain resource type. Automatically generated from version 3.0.0.0
Properties
The following properties are available in the dsc_xwaitforaddomain
type.
dsc_rebootretrycount
Data type: Optional[Integer[0, 4294967295]]
The number of times to reboot after failing and then restart retrying.
dsc_retrycount
Data type: Optional[Integer[0, 4294967295]]
The number of retries before failing.
dsc_retryintervalsec
Data type: Optional[Integer[0, 18446744073709551615]]
The interval in seconds between retry attempts.
Parameters
The following parameters are available in the dsc_xwaitforaddomain
type.
dsc_domainname
namevar
Data type: String
The name of the AD Domain to wait for.
dsc_domainusercredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
The user account credentials to use to perform this task.
dsc_psdscrunascredential
Data type: Optional[Struct[{ user => String[1], password => Sensitive[String[1]] }]]
name
namevar
Data type: String
Description of the purpose for this resource declaration.
validation_mode
Data type: Enum[property, resource]
Whether to check if the resource is in the desired state by property (default) or using Invoke-DscResource in Test mode (resource).
Default value: property
Change log for xActiveDirectory
Unreleased
3.0.0.0
- Changes to xActiveDirectory
- Added new helper functions in xADCommon, see each functions comment-based
help for more information.
- Convert-PropertyMapToObjectProperties
- Compare-ResourcePropertyState
- Test-DscPropertyState
- Move the examples in the README.md to Examples folder.
- Fix Script Analyzer rule failures.
- Opt-in to the following DSC Resource Common Meta Tests:
- Common Tests - Custom Script Analyzer Rules
- Common Tests - Required Script Analyzer Rules
- Common Tests - Flagged Script Analyzer Rules
- Common Tests - Validate Module Files (issue #282)
- Common Tests - Validate Script Files (issue #283)
- Common Tests - Relative Path Length (issue #284)
- Common Tests - Validate Markdown Links (issue #280)
- Common Tests - Validate Localization (issue #281)
- Common Tests - Validate Example Files (issue #279)
- Common Tests - Validate Example Files To Be Published (issue #311)
- Move resource descriptions to Wiki using auto-documentation (issue #289)
- Move helper functions from MSFT_xADCommon to the module
xActiveDirectory.Common (issue #288).
- Removed helper function
Test-ADDomain
since it was not used. The helper function had design flaws too. - Now the helper function
Test-Members
outputs all the members that are not in desired state when verbose output is enabled.
- Removed helper function
- Update all unit tests to latest unit test template.
- Deleted the obsolete xActiveDirectory_TechNetDocumentation.html file.
- Added new resource xADObjectEnabledState. This resource should be
used to enforce the
Enabled
property of computer accounts. This resource replaces the deprecatedEnabled
property in the resource xADComputer. - Cleanup of code
- Removed semicolon throughout where it is not needed.
- Migrate tests to Pester syntax v4.x (issue #322).
- Removed
-MockWith {}
in unit tests. - Use fully qualified type names for parameters and variables (issue #374).
- Removed unused legacy test files from the root of the repository.
- Updated Example List README with missing resources.
- Added missing examples for xADReplicationSubnet, xADServicePrincipalName and xWaitForADDomain. (issue #395).
- Added new helper functions in xADCommon, see each functions comment-based
help for more information.
- Changes to xADComputer
- Refactored the resource and the unit tests.
- BREAKING CHANGE: The
Enabled
property is DEPRECATED and is no longer set or enforces with this resource. If this parameter is used in a configuration a warning message will be outputted saying that theEnabled
parameter has been deprecated. The new resource xADObjectEnabledState can be used to enforce theEnabled
property. - BREAKING CHANGE: The default value of the enabled property of the
computer account will be set to the default value of the cmdlet
New-ADComputer
. - A new parameter was added called
EnabledOnCreation
that will control if the computer account is created enabled or disabled. - Moved examples from the README.md to separate example files in the Examples folder.
- Fix the RestoreFromRecycleBin description.
- Fix unnecessary cast in
Test-TargetResource
(issue #295). - Fix ServicePrincipalNames property empty string exception (issue #382).
- Changes to xADGroup
- Change the description of the property RestoreFromRecycleBin.
- Code cleanup.
- Changes to xADObjectPermissionEntry
- Change the description of the property IdentityReference.
- Fix failure when applied in the same configuration as xADDomain.
- Localize and Improve verbose messaging.
- Code cleanup.
- Changes to xADOrganizationalUnit
- Change the description of the property RestoreFromRecycleBin.
- Code cleanup.
- Fix incorrect verbose message when this resource has Ensure set to Absent (issue #276).
- Changes to xADUser
- Change the description of the property RestoreFromRecycleBin.
- Added ServicePrincipalNames property (issue #153).
- Added ChangePasswordAtLogon property (issue #246).
- Code cleanup.
- Added LogonWorkstations property
- Added Organization property
- Added OtherName property
- Added AccountNotDelegated property
- Added AllowReversiblePasswordEncryption property
- Added CompoundIdentitySupported property
- Added PasswordNotRequired property
- Added SmartcardLogonRequired property
- Added ProxyAddresses property (Issue #254).
- Fix Password property being updated whenever another property is changed (issue #384).
- Replace Write-Error with the correct helper function (Issue #331).
- Changes to xADDomainController
- Change the
#Requires
statement in the Examples to require the correct module. - Suppressing the Script Analyzer rule
PSAvoidGlobalVars
since the resource is using the$global:DSCMachineStatus
variable to trigger a reboot. - Code cleanup.
- Change the
- Changes to xADDomain
- Suppressing the Script Analyzer rule
PSAvoidGlobalVars
since the resource is using the$global:DSCMachineStatus
variable to trigger a reboot. - Code cleanup.
- Suppressing the Script Analyzer rule
- Changes to xADDomainTrust
- Replaced New-TerminatingError with Standard Function.
- Code cleanup.
- Changes to xWaitForADDomain
- Suppressing the Script Analyzer rule
PSAvoidGlobalVars
since the resource is using the$global:DSCMachineStatus
variable to trigger a reboot. - Added missing property schema descriptions (issue #369).
- Code cleanup.
- Suppressing the Script Analyzer rule
- Changes to xADRecycleBin
- Remove unneeded example and resource designer files.
- Added missing property schema descriptions (issue #368).
- Code cleanup.
- It now sets back the
$ErrorActionPreference
that was set prior to setting it to'Stop'
. - Replace Write-Error with the correct helper function (issue #327).
- Changes to xADReplicationSiteLink
- Fix ADIdentityNotFoundException when creating a new site link.
- Code cleanup.
- Changes to xADReplicationSubnet
- Remove
{ *Present* | Absent }
from the property schema descriptions which were causing corruption in the Wiki documentation.
- Remove
- Changes to xADServicePrincipalNames
- Remove
{ *Present* | Absent }
from the property schema descriptions which were causing corruption in the Wiki documentation.
- Remove
- Changes to xADDomainDefaultPasswordPolicy
- Code cleanup.
- Changes to xADForestProperties
- Minor style cleanup.
- Changes to xADReplicationSubnet
- Code cleanup.
- Changes to xADKDSKey
- Code cleanup.
- Changes to xADManagedServiceAccount
- Code cleanup.
- Changes to xADServicePrincipalName
- Code cleanup.
2.26.0.0
- Changes to xActiveDirectory
- Added localization module -DscResource.LocalizationHelper* containing
the helper functions
Get-LocalizedData
,New-InvalidArgumentException
,New-InvalidOperationException
,New-ObjectNotFoundException
, andNew-InvalidResultException
(issue #257). For more information around these helper functions and localization in resources, see Localization section in the Style Guideline. - Added common module DscResource.Common containing the helper function
Test-DscParameterState
. The goal is that all resource common functions are moved to this module (functions that are or can be used by more than one resource) (issue #257). - Added xADManagedServiceAccount resource to manage Managed Service Accounts (MSAs). Andrew Wickham (@awickham10) and @kungfu71186
- Removing the Misc Folder, as it is no longer required.
- Added xADKDSKey resource to create KDS Root Keys for gMSAs. @kungfu71186
- Combined DscResource.LocalizationHelper and DscResource.Common Modules into xActiveDirectory.Common
- Added localization module -DscResource.LocalizationHelper* containing
the helper functions
- Changes to xADReplicationSiteLink
- Make use of the new localization helper functions.
- Changes to xAdDomainController
- Added new parameter to disable or enable the Global Catalog (GC) (issue #75). Eric Foskett @Merto410
- Fixed a bug with the parameter
InstallationMediaPath
that it would not be added if it was specified in a configuration. Now the parameterInstallationMediaPath
is correctly passed toInstall-ADDSDomainController
. - Refactored the resource with major code cleanup and localization.
- Updated unit tests to latest unit test template and refactored the tests for the function 'Set-TargetResource'.
- Improved test code coverage.
- Changes to xADComputer
- Restoring a computer account from the recycle bin no longer fails if
there is more than one object with the same name in the recycle bin.
Now it uses the object that was changed last using the property
whenChanged
(issue #271).
- Restoring a computer account from the recycle bin no longer fails if
there is more than one object with the same name in the recycle bin.
Now it uses the object that was changed last using the property
- Changes to xADGroup
- Restoring a group from the recycle bin no longer fails if there is
more than one object with the same name in the recycle bin. Now it
uses the object that was changed last using the property
whenChanged
(issue #271).
- Restoring a group from the recycle bin no longer fails if there is
more than one object with the same name in the recycle bin. Now it
uses the object that was changed last using the property
- Changes to xADOrganizationalUnit
- Restoring an organizational unit from the recycle bin no longer fails
if there is more than one object with the same name in the recycle bin.
Now it uses the object that was changed last using the property
whenChanged
(issue #271).
- Restoring an organizational unit from the recycle bin no longer fails
if there is more than one object with the same name in the recycle bin.
Now it uses the object that was changed last using the property
- Changes to xADUser
- Restoring a user from the recycle bin no longer fails if there is
more than one object with the same name in the recycle bin. Now it
uses the object that was changed last using the property
whenChanged
(issue #271).
- Restoring a user from the recycle bin no longer fails if there is
more than one object with the same name in the recycle bin. Now it
uses the object that was changed last using the property
2.25.0.0
- Added xADReplicationSiteLink
- New resource added to facilitate replication between AD sites
- Updated xADObjectPermissionEntry to use
AD:
which is more generic when usingGet-Acl
andSet-Acl
than usingMicrosoft.ActiveDirectory.Management\ActiveDirectory:://RootDSE/
- Changes to xADComputer
- Minor clean up of unit tests.
- Changes to xADUser
- Added TrustedForDelegation parameter to xADUser to support enabling/disabling Kerberos delegation
- Minor clean up of unit tests.
- Added Ensure Read property to xADDomainController to fix Get-TargetResource return bug (issue #155).
- Updated readme and add release notes
- Updated xADGroup to support group membership from multiple domains (issue #152). Robert Biddle (@robbiddle) and Jan-Hendrik Peters (@nyanhp)
2.24.0.0
- Added parameter to xADDomainController to support InstallationMediaPath (issue #108).
- Updated xADDomainController schema to be standard and provide Descriptions.
2.23.0.0
- Explicitly removed extra hidden files from release package
2.22.0.0
- Add PasswordNeverResets parameter to xADUser to facilitate user lifecycle management
- Update appveyor.yml to use the default template.
- Added default template files .gitattributes, and .gitignore, and .vscode folder.
- Added xADForestProperties: New resource to manage User and Principal Name Suffixes for a Forest.
2.21.0.0
- Added xADObjectPermissionEntry
- New resource added to control the AD object permissions entries Claudio Spizzi (@claudiospizzi)
- Changes to xADCommon
- Assert-Module has been extended with a parameter ImportModule to also import the module (issue #218). Jan-Hendrik Peters (@nyanhp)
- Changes to xADDomain
- xADDomain makes use of new parameter ImportModule of Assert-Module in order to import the ADDSDeployment module (issue #218). Jan-Hendrik Peters (@nyanhp)
- xADComputer, xADGroup, xADOrganizationalUnit and xADUser now support restoring from AD recycle bin (Issue #221). Jan-Hendrik Peters (@nyanhp)
2.20.0.0
- Changes to xActiveDirectory
- Changed MSFT_xADUser.schema.mof version to "1.0.0.0" to match other resources (issue #190). thequietman44 (@thequietman44)
- Removed duplicated code from examples in README.md (issue #198). thequietman44 (@thequietman44)
- xADDomain is now capable of setting the forest and domain functional level (issue #187). Jan-Hendrik Peters (@nyanhp)
2.19.0.0
- Changes to xActiveDirectory
- Activated the GitHub App Stale on the GitHub repository.
- The resources are now in alphabetical order in the README.md (issue #194).
- Adding a Branches section to the README.md with Codecov badges for both master and dev branch (issue #192).
- xADGroup no longer resets GroupScope and Category to default values (issue #183).
- The helper function script file MSFT_xADCommon.ps1 was renamed to MSFT_xADCommon.psm1 to be a module script file instead. This makes it possible to report code coverage for the helper functions (issue #201).
2.18.0.0
- xADReplicationSite: Resource added.
- Added xADReplicationSubnet resource.
- Fixed bug with group members in xADGroup
2.17.0.0
- Converted AppVeyor.yml to use DSCResource.tests shared code.
- Opted-In to markdown rule validation.
- Readme.md modified resolve markdown rule violations.
- Added CodeCov.io support.
- Added xADServicePrincipalName resource.
2.16.0.0
- xAdDomainController: Update to complete fix for SiteName being required field.
- xADDomain: Added retry logic to prevent FaultException to crash in Get-TargetResource on subsequent reboots after a domain is created because the service is not yet running. This error is mostly occur when the resource is used with the DSCExtension on Azure.
2.15.0.0
- xAdDomainController: Fixes SiteName being required field.
2.14.0.0
- xADDomainController: Adds Site option.
- xADDomainController: Populate values for DatabasePath, LogPath and SysvolPath during Get-TargetResource.
2.13.0.0
- Converted AppVeyor.yml to pull Pester from PSGallery instead of Chocolatey
- xADUser: Adds 'PasswordAuthentication' option when testing user passwords to support NTLM authentication with Active Directory Certificate Services deployments
- xADUser: Adds descriptions to user properties within the schema file.
- xADGroup: Fixes bug when updating groups when alternate Credentials are specified.
2.12.0.0
- xADDomainController: Customer identified two cases of incorrect variables being called in Verbose output messages. Corrected.
- xADComputer: New resource added.
- xADComputer: Added RequestFile support.
- Fixed PSScriptAnalyzer Errors with v1.6.0.
2.11.0.0
- xWaitForADDomain: Made explicit credentials optional and other various updates
2.10.0.0
- xADDomainDefaultPasswordPolicy: New resource added.
- xWaitForADDomain: Updated to make it compatible with systems that don't have the ActiveDirectory module installed, and to allow it to function with domains/forests that don't have a domain controller with Active Directory Web Services running.
- xADGroup: Fixed bug where specified credentials were not used to retrieve existing group membership.
- xADDomain: Added check for Active Directory cmdlets.
- xADDomain: Added additional error trapping, verbose and diagnostic information.
- xADDomain: Added unit test coverage.
- Fixes CredentialAttribute and other PSScriptAnalyzer tests in xADCommon, xADDomin, xADGroup, xADOrganizationalUnit and xADUser resources.
2.9.0.0
- xADOrganizationalUnit: Merges xADOrganizationalUnit resource from the PowerShell gallery
- xADGroup: Added Members, MembersToInclude, MembersToExclude and MembershipAttribute properties.
- xADGroup: Added ManagedBy property.
- xADGroup: Added Notes property.
- xADUser: Adds additional property settings.
- xADUser: Adds unit test coverage.
2.8.0.0
- Added new resource: xADGroup
- Fixed issue with NewDomainNetbiosName parameter.
2.7.0.0
- Added DNS flush in retry loop
- Bug fixes in xADDomain resource
2.6.0.0
- Removed xDscResourceDesigner tests (moved to common tests)
2.5.0.0
- Updated xADDomainTrust and xADRecycleBin tests
2.4.0.0
- Added xADRecycleBin resource
- Minor fixes for xADUser resource
2.3
- Added xADRecycleBin.
- Modified xADUser to include a write-verbose after user is removed when Absent.
- Corrected xADUser to successfully create a disabled user without a password.
2.2
- Modified xAdDomain and xAdDomainController to support Ensure as Present / Absent, rather than True/False. Note: this may cause issues for existing scripts.
- Corrected return value to be a hashtable in both resources.
2.1.0.0
- Minor update: Get-TargetResource to use domain name instead of name.
2.0.0.0
- Updated release, which added the resource:
- xADDomainTrust
1.0.0.0
- Initial release with the following resources:
- xADDomain, xADDomainController, xADUser, and xWaitForDomain
Dependencies
- puppetlabs/pwshlib (>= 0.9.0 < 2.0.0)