Every imaging and provisioning pipeline that joins machines to Active Directory holds a credential that can create computer objects, and that credential is often a Domain Admin password sitting in an answer file or task sequence. Domain join accounts are non-human identities: they run unattended, are shared across build systems and are rarely rotated because a change breaks imaging. This guide treats the join account as an identity with a lifecycle. It covers the join methods that use one, the minimum rights each needs, how Microsoft's 2022 to 2024 domain join hardening changes the design, where the secret should live, and how to monitor and rotate it. It is for Active Directory, endpoint and VDI engineers and the identity teams that govern service accounts.
Key takeaways
- Never use an admin account to join. Microsoft's guidance for Configuration Manager is one domain user account with minimal rights to join the domain, no interactive sign-in, and not the network access account. Its domain join hardening guidance says not to put provisioning accounts in Domain Admins.
- Delegate on a staging OU, then close the quota. Give the join identity create rights on one OU and remove the default that lets any authenticated user add up to 10 workstations.
- Account reuse now has rules. Since the October 2022 updates (CVE-2022-38042), a join can reuse an existing computer account only if the joining account created it, an admin group created it, or its owner is on an allowlist. Design pre-staging around this.
- The secret is the risk. Join passwords leak through unattend files, task sequence variables, scripts and images. Store them in a vault, inject them at run time and rotate them.
- Prefer methods with no shared password. Group managed service accounts for connectors, offline domain join blobs scoped to one machine, or Microsoft Entra join for new devices reduce or remove the reusable credential.
Where domain join accounts live
Most estates have several join identities, often created by different teams. Inventory them first; the Service Account Inventory Template works well for this.
| Join path | Identity that joins | Where the credential typically sits | Typical exposure |
|---|---|---|---|
| Configuration Manager OSD | Task sequence domain join account | Join Domain or Workgroup and Apply Network Settings steps; delivered to clients in policy | Shared by all task sequences; admin rights granted "to make it work" |
| Windows Autopilot hybrid join | Intune Connector for Active Directory, which creates a managed service account (msaODJ#####) | Managed by Windows, no human-held password | Connector server becomes a tier 0 adjacent asset; over-broad OU rights |
| Unattended Windows Setup | Account in the UnattendedJoin credentials of an answer file | unattend.xml in images, shares and deployment tools | Plain or weakly encoded password copied into every build |
| Image builders and VDI provisioning | Service account used by image pipelines and host pool or machine catalogue tools | Pipeline variables, key vaults, hypervisor or broker configuration | Long-lived password, broad OU rights, no owner |
| Scripts and automation | Account passed to join cmdlets | Script files, scheduled tasks, CI variables | Hard-coded passwords in repositories |
| Offline domain join | Admin or delegated account running the provisioning step | Provisioning blob for one named machine | Blob copied to shares or kept after use |
For Windows Autopilot, note that Microsoft now recommends deploying new devices as cloud-native with Microsoft Entra join and states that hybrid join, including through Autopilot, is not recommended for new devices. The hybrid guidance remains for existing environments; see the Entra Device Identity guide.
The rights a join really needs
Three Active Directory controls decide who can join, and they interact.
| Control | Default | Effect | Recommended setting (ours) |
|---|---|---|---|
| User right "Add workstations to domain" | Effectively Authenticated Users on domain controllers | Holder can add workstations; accounts created this way are owned by Domain Admins | Restrict to a named IT group, or remove broad groups once delegation works |
ms-DS-MachineAccountQuota | 10 per user | Limits joins through the user right; does not apply to admins or to delegated create rights on a container | 0, once delegated joins are tested |
| Create Computer objects on an OU or the Computers container | Not delegated | Unlimited joins in that container; creator owns the object | Grant to the join identity on one staging OU only |
Microsoft's Autopilot connector guidance shows the minimal pattern: on the target OU, grant the connector's managed service account only Create Computer objects, applied to this object only. Microsoft's connector guidance grants nothing beyond that. If a join path must also rejoin or reset machines it created, add only the specific rights on descendant computer objects that your testing shows it needs (our recommendation), rather than Full Control. Grant only what your join path needs, test it in a lab OU, and record the delegation. The Active Directory Delegation guide covers the delegation model and the quota change in more depth.
Never grant
- Membership of Domain Admins, Enterprise Admins, Administrators or Account Operators.
- Full Control or Write all properties on an OU, or any right on the domain root.
- Interactive or remote desktop sign-in.
- Reuse of the account as the Configuration Manager network access account or any other service.
Domain join hardening and account reuse
Microsoft's netjoin hardening (KB5020276) changed what a join account can do with existing computer objects. Since the 11 October 2022 updates, a join cannot reuse an existing computer account unless the joining account created it, a Domain Admin created it (extended to Enterprise Admins and Built-in Administrators in March 2023), or the object's owner is on an allowlist. Blocked joins fail with error 0xaac (2732), NERR_AccountReuseBlockedByPolicy. The 13 August 2024 update removed support for the NetJoinLegacyAccountReuse registry key, so the old bypass no longer works.
| Scenario | What now happens | Secure design |
|---|---|---|
| Reimaging a machine with the same name | Allowed if the join identity created the object | Use one join identity per pipeline so it owns what it creates |
| Objects pre-staged by a helpdesk account, joined by the pipeline | Blocked unless the pre-staging account is allowlisted | Add the pre-staging group (not the join account) to "Domain controller: Allow computer account re-use during domain join" |
| Legacy objects with deleted owners | Blocked; logged as orphaned | Delete stale objects and rejoin, rather than hand-editing security descriptors |
Microsoft's practices from the same article: join with the account that created the computer account, delete stale accounts before rejoining, use groups rather than broad principals in the allowlist, do not add the join account itself to the allowlist, and do not put service or provisioning accounts in Domain Admins. Since the September 2023 update the checks run on domain controllers through authenticated SAM remote calls, which can fail where "Network access: Restrict clients allowed to make remote calls to SAM" is restricted, so test after hardening SAM access.
Protecting the secret
- Vault and inject: keep the join password in a secrets manager and inject it at run time into the pipeline or deployment tool, rather than writing it into images, answer files or scripts. See the Server Build and Golden Image Hardening Guide for removing build credentials before capture.
- Use managed accounts where supported: connectors that run as a Windows service can use a group managed service account, which Windows rotates; see the Group Managed Service Accounts (gMSA) Guide.
- Scope offline join blobs: an offline domain join provisioning file is created for one named machine. Treat it as a secret (our recommendation): generate it just in time, transfer it securely and delete it after use.
- Separate pipelines: one join identity per pipeline (for example OSD, VDI, servers) limits blast radius and makes ownership and reuse rules work.
- Rotate on a schedule and on events: rotate when staff with access leave, after any image or share exposure, and on a fixed cycle (our suggestion: at least every 90 days for human-set passwords). Update every consuming tool in the same change; in Configuration Manager that means updating the password in each task sequence that uses the account.
- Deny sign-in: apply "Deny log on locally" and "Deny log on through Remote Desktop Services" to join accounts, and add them to the privileged access tiering model as provisioning identities.
Implementation: moving to least privilege
- Discover: list accounts that created recent computer objects (the
ms-DS-CreatorSIDattribute shows quota-based creators), search answer files, task sequences, pipeline variables and scripts for join credentials, and note each account's group memberships. - Design: create a staging OU per join path, one join identity per pipeline, and a security group for any pre-staging staff.
- Delegate and test: grant the minimal rights on the staging OU and run test builds, including a reimage of an existing name, in a pilot collection or host pool.
- Cut over: switch each pipeline to its new identity and vault-backed secret. Keep the old account enabled but monitored for one build cycle as a rollback.
- Remove old rights: take the old account out of admin groups, then disable it, then delete it after a quiet period.
- Close the defaults: set
ms-DS-MachineAccountQuotato 0 and restrict "Add workstations to domain" once no workflow depends on them. - Govern: assign an owner, add the identity to service account reviews, and document its rotation procedure.
Rollback is simple at each stage: re-enable the previous account or restore the previous delegation. Avoid re-adding admin rights as a quick fix; check C:\Windows\Debug\netsetup.log on the failing client first.
Detection and measurement
| Event or source | Where | Use |
|---|---|---|
| 4741 (computer account created) | Domain controller Security log | Alert when a join identity creates objects outside its staging OU, or a non-join account creates computers |
| 4624 and 4625 for the join account | Domain controllers and endpoints | Join accounts should not sign in interactively or from unexpected hosts |
| Netjoin 4100 and 4101 | Client System log | Account reuse permitted or blocked |
| Directory-Services-SAM 16995 to 16998 | Domain controller System log | Allowlist in use or malformed, orphaned accounts, rejected reuse |
| 4728, 4732, 4756 (member added to a security group) | Domain controller Security log | Join identity added to any privileged group |
| Directory change auditing on the staging OU | Domain controller Security log | Changes to the delegation itself |
- Privilege: number of join identities with membership of any admin group (target: zero).
- Quota exposure:
ms-DS-MachineAccountQuotavalue and number of computer objects created through it in the last 90 days. - Secret hygiene: join credentials found in images, shares or repositories in scans (target: zero), and days since last rotation.
- Ownership: share of join identities with a named owner and a documented rotation procedure.
- Containment: computer objects created outside staging OUs by join identities.
Common failure patterns
- Domain Admin as join account: a build credential that can do anything in the domain, readable by anyone who can open a task sequence or image.
- Password in the golden image: an answer file with join credentials ships in every host and every copy of the image.
- Re-adding admin rights after hardening errors: teams hit 0xaac after the 2022 updates and fix it by elevating the join account rather than fixing ownership or the allowlist.
- Quota left at 10: any user can create computer accounts, which attackers use as a ready-made machine identity for later attacks such as resource-based constrained delegation abuse; see the Kerberos Delegation Security Guide.
- One account for everything: a single join account shared by OSD, VDI and scripts cannot be rotated without breaking several teams, so it never is.
Framework mapping
| Framework | Reference | How it applies |
|---|---|---|
| NIST SP 800-53 Rev. 5 | AC-6, AC-6(5) | Least privilege; restricting privileged accounts |
| NIST SP 800-53 Rev. 5 | AC-2, IA-5 | Account management and ownership; authenticator protection and rotation |
| NIST SP 800-53 Rev. 5 | CM-6, AU-12 | Configuration of quota and user rights; audit of account creation |
| MITRE ATT&CK | T1078 Valid Accounts, T1098 Account Manipulation | Abuse of a leaked join account and changes to its rights |
| NIST CSF 2.0 | PR.PS-01, DE.CM-09 | Configuration management; monitoring of systems |
Practitioner checklist
- Inventory every join identity and every place its password is stored.
- Remove join identities from all admin groups and deny interactive and RDP sign-in.
- Delegate Create Computer objects on one staging OU per pipeline.
- Set
ms-DS-MachineAccountQuotato 0 and restrict "Add workstations to domain". - Allowlist pre-staging groups, never the join account, for computer account reuse.
- Move join passwords into a vault, or to managed service accounts where supported.
- Strip credentials from answer files and images before capture.
- Alert on 4741 outside staging OUs and on any group change for join identities.
- Assign owners and add join identities to service account reviews.
Standards and references
- Microsoft Support: KB5020276 Netjoin domain join hardening changes
- Microsoft Learn: Default limit to number of workstations a user can join to the domain
- Microsoft Learn: Add workstations to domain
- Microsoft Learn: Accounts used in Configuration Manager
- Microsoft Learn: Windows Autopilot hybrid join
- Microsoft Learn: Offline domain join with djoin
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: Service Account Security Guide · Active Directory Delegation · Server Build and Golden Image Hardening Guide · How to find service accounts with Domain Admin rights