ActiveDirectoryDsc
repository·main·Indexed 18 days ago
https://github.com/dsccommunity/activedirectorydscA PowerShell Desired State Configuration (DSC) module for automating the deployment and management of Active Directory environments. It provides resources to configure domains, child domains, domain controllers (including RODCs), cross-domain trusts, and directory objects such as users, groups, and Organizational Units (OUs). It also includes resources for managing password policies, functional levels, and forest-wide properties.
What's inside ActiveDirectoryDsc
- ActiveDirectoryDsc is a Desired State Configuration (DSC) module containing resources for the deployment and configuration of Active Directory. It is designed to automate the management of domain infrastructures and directory objects.
Overview of the ActiveDirectoryDsc.Common module
mainTheActiveDirectoryDsc.Commonmodule is a PowerShell module providing a collection of utility functions and cmdlets used across the various modules in theActiveDirectoryDscecosystem. It contains shared logic for Active Directory operations, type conversions, and resource state comparisons.Use the ADDomain resource to create domains
mainThe
ADDomainresource is used to create a new domain within a new forest or to create a child domain within an existing forest.Note that while you can specify the forest functional level and the domain functional level during deployment using this resource, standard Active Directory functional level restrictions apply. For detailed information on functional levels, refer to Microsoft's documentation on Active Directory functional levels.
Manage Active Directory Domain Trusts with ADDomainTrust
mainThe
ADDomainTrustDSC resource is used to manage Domain Trust relationships within Active Directory. These relationships can be established between individual domains or entire forests.For conceptual guidance on how to design these relationships, refer to the Microsoft documentation on Forest Design Models.
Use the ADDomainController DSC resource
mainThe
ADDomainControllerDSC resource is used to install and configure domain controllers in Active Directory. It supports the installation of both standard domain controllers and Read-Only Domain Controllers (RODC).Key Behaviors and Constraints
- DNS Installation: You can promote a domain controller using an existing DNS by using the
InstallDnsparameter. This specifies whether the DNS Server service should be installed and configured.- Note:
InstallDnsis only used during the initial provisioning of a domain controller. It cannot be used to install or uninstall the DNS server on a domain controller that has already been provisioned.
- Note:
- FSMO Roles: The
FlexibleSingleMasterOperationRoleparameter is ignored until the node has been successfully provisioned as a domain controller.- Warning: When moving Flexible Single Master Operation (FSMO) roles, ensure they are moved carefully to avoid "ping-pong" behavior where two domain controllers attempt to claim ownership of the same role.
- Limitation: This resource does not support the seizing of FSMO roles.
- Credentials: When using the
Credentialparameter, ensure the account provided can connect to an existing domain controller. If using a credential without a domain name, the underlyingInstall-ADDSDomainControllercmdlet may hang without reporting an error while attempting replication.
- DNS Installation: You can promote a domain controller using an existing DNS by using the
Manage Service Principal Names (SPN) with MSFT_ADServicePrincipalName
mainTheMSFT_ADServicePrincipalNameDSC resource is used to manage Service Principal Names (SPNs). An SPN is a unique identifier for a service instance used by Kerberos authentication to associate a service instance with a specific service logon account. This enables client applications to authenticate services even without knowing the specific account name.Manage Active Directory Replication Site Links with ADReplicationSiteLink
mainTheADReplicationSiteLinkDSC resource is used to manage Replication Site Links within Active Directory. Site links are used to connect two or more sites, reflecting administrative policies for interconnecting sites and defining the methods used to transfer replication traffic. Connecting sites with site links is required to ensure domain controllers at different sites can replicate Active Directory changes.Manage Active Directory Users with ADUser DSC resource
mainThe
ADUserDSC resource is used to manage User objects within Active Directory. It allows you to define the desired state of users, including properties related to their account configuration and lifecycle.Requirements
- Operating System: The target machine must be running Windows Server 2008 R2 or later.
- Recycle Bin Configuration: If you use the
RestoreFromRecycleBinparameter, the Active Directory Recycle Bin feature must be enabled before objects are deleted. If the Recycle Bin is disabled, themsDS-LastKnownRDNproperty will not be added to deleted objects, which may affect restoration capabilities.
Manage Active Directory domain default password policies with ADDomainDefaultPasswordPolicy
mainTheADDomainDefaultPasswordPolicyDSC resource is used to manage and enforce the default password policy for an Active Directory domain. This resource ensures that the domain-wide password settings (such as complexity requirements, minimum length, etc.) are configured according to your desired state.Manage Active Directory fine-grained password policies with ADFineGrainedPasswordPolicy
mainTheADFineGrainedPasswordPolicyDSC resource is used to manage fine-grained password policies within an Active Directory domain. Use this resource to define and enforce specific password requirements for different groups of users or objects in your domain.Manage Managed Service Accounts with ADManagedServiceAccount
mainThe
ADManagedServiceAccountDSC resource is used to manage Single Managed Service Accounts (MSAs) and Group Managed Service Accounts (gMSAs) within Active Directory.Managed Service Accounts provide:
- Automatic password management.
- Simplified Service Principal Name (SPN) management.
- Delegated management capabilities.
Key Differences:
- Single Managed Service Account (MSA): Restricted to use on a single computer.
- Group Managed Service Account (gMSA): Can be shared across multiple computers in the domain.
Manage KDS Root Keys with MSFT_ADKDSKey
mainTheMSFT_ADKDSKeyDSC resource is used to manage KDS (Key Distribution Service) Root Keys within Active Directory. These root keys are a prerequisite for generating passwords for Group Managed Service Accounts (gMSA).