ActiveDirectoryDsc

repository·main·Indexed 18 days ago

https://github.com/dsccommunity/activedirectorydsc

A 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.

Tokens
19.2K
Snippets
61
Records
155
Agent score
60%

What's inside ActiveDirectoryDsc

  1. Use the ADDomain resource to create domains

    main

    The ADDomain resource 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.

  2. Use the ADDomainController DSC resource

    main

    The ADDomainController DSC 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 InstallDns parameter. This specifies whether the DNS Server service should be installed and configured.
      • Note: InstallDns is 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.
    • FSMO Roles: The FlexibleSingleMasterOperationRole parameter 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 Credential parameter, ensure the account provided can connect to an existing domain controller. If using a credential without a domain name, the underlying Install-ADDSDomainController cmdlet may hang without reporting an error while attempting replication.
  3. Manage Service Principal Names (SPN) with MSFT_ADServicePrincipalName

    main
    The MSFT_ADServicePrincipalName DSC 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.
  4. Manage Active Directory Replication Site Links with ADReplicationSiteLink

    main
    The ADReplicationSiteLink DSC 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.
  5. Manage Active Directory Users with ADUser DSC resource

    main

    The ADUser DSC 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 RestoreFromRecycleBin parameter, the Active Directory Recycle Bin feature must be enabled before objects are deleted. If the Recycle Bin is disabled, the msDS-LastKnownRDN property will not be added to deleted objects, which may affect restoration capabilities.
  6. Manage Active Directory domain default password policies with ADDomainDefaultPasswordPolicy

    main
    The ADDomainDefaultPasswordPolicy DSC 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.
  7. Manage Managed Service Accounts with ADManagedServiceAccount

    main

    The ADManagedServiceAccount DSC 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.