|
| 1 | +--- |
| 2 | +title: Failure When You Use an Existing Computer Account to Join a Domain |
| 3 | +description: Addresses the issue of failing to join a computer to a domain when an existing computer account with the same name already exists. |
| 4 | +ms.date: 03/28/2025 |
| 5 | +manager: dcscontentpm |
| 6 | +audience: itpro |
| 7 | +ms.topic: troubleshooting |
| 8 | +ms.reviewer: raviks, eriw, dennhu |
| 9 | +ms.custom: |
| 10 | +- sap:active directory\on-premises active directory domain join |
| 11 | +- pcy:WinComm Directory Services |
| 12 | +--- |
| 13 | +# Failure when you use an existing computer account to join a domain |
| 14 | + |
| 15 | +This article addresses the issue of failing to join a computer to a domain when an existing computer account with the same name already exists. |
| 16 | + |
| 17 | +## Symptoms |
| 18 | + |
| 19 | +When you try to use an existing computer account name to join a computer to a domain, the operation fails and you receive the following error messages: |
| 20 | + |
| 21 | +In the **Access work or school** page: |
| 22 | +> Can't join this domain. Contact your IT admin for more info. |
| 23 | +
|
| 24 | +In **System Properties**: |
| 25 | +> The following error occurred attempting to join the domain "\<domain_name\>": |
| 26 | +> |
| 27 | +> An account with the same name exists in Active Directory. |
| 28 | +> Re-using the account was blocked by security policy. |
| 29 | +
|
| 30 | +### Netsetup.log |
| 31 | + |
| 32 | +Review the following example of the **Netsetup.log** file on a fully updated system. |
| 33 | + |
| 34 | +```output |
| 35 | +NetpProvisionComputerAccount: |
| 36 | + lpDomain: contoso.com |
| 37 | + lpHostName: host1 |
| 38 | + lpMachineAccountOU: (NULL) |
| 39 | + lpDcName: ContosoDC1.contoso.com |
| 40 | + lpMachinePassword: (null) |
| 41 | + lpAccount: contoso\nonadminuser2 |
| 42 | + lpPassword: (non-null) |
| 43 | + dwJoinOptions: 0x403 |
| 44 | + dwOptions: 0x40000003 |
| 45 | +NetpLdapBind: Verified minimum encryption strength on ContosoDC1.contoso.com: 0x0 |
| 46 | +NetpLdapGetLsaPrimaryDomain: reading domain data |
| 47 | +NetpGetNCData: Reading NC data |
| 48 | +NetpGetDomainData: Lookup domain data for: DC=contoso,DC=com |
| 49 | +NetpGetDomainData: Lookup crossref data for: CN=Partitions,CN=Configuration,DC=contoso,DC=com |
| 50 | +NetpLdapGetLsaPrimaryDomain: result of retrieving domain data: 0x0 |
| 51 | +NetpCheckForDomainSIDCollision: returning 0x0(0). |
| 52 | +NetpGetComputerObjectDn: Cracking DNS domain name contoso.com/ into Netbios on \\ContosoDC1.contoso.com |
| 53 | +NetpGetComputerObjectDn: Crack results: name = CONTOSO\ |
| 54 | +NetpGetComputerObjectDn: Cracking account name CONTOSO\HOST1$ on \\ContosoDC1.contoso.com |
| 55 | +NetpGetComputerObjectDn: Crack results: (Account already exists) DN = CN=HOST1,CN=Computers,DC=contoso,DC=com |
| 56 | +NetpGetADObjectOwnerAttributes: Looking up attributes for machine account: CN=HOST1,CN=Computers,DC=contoso,DC=com |
| 57 | +NetpGetNCData: Reading NC data |
| 58 | +NetpReadAccountReuseModeFromAD: Searching '<WKGUID=AB1D30F3768811D1ADED00C04FD8D5CD,DC=contoso,DC=com>' for '(&(ObjectClass=ServiceConnectionPoint)(KeyWords=NetJoin*))'. |
| 59 | +NetpReadAccountReuseModeFromAD: Got 0 Entries. |
| 60 | +Returning NetStatus: 0, ADReuseMode: 0 |
| 61 | +IsLegacyAccountReuseSetInRegistry: RegQueryValueEx for 'NetJoinLegacyAccountReuse' returned Status: 0x2. |
| 62 | +IsLegacyAccountReuseSetInRegistry returning: 'FALSE''. |
| 63 | +NetpDsValidateComputerAccountReuseAttempt: returning NtStatus: 0, NetStatus: 0 |
| 64 | +NetpDsValidateComputerAccountReuseAttempt: returning Result: FALSE |
| 65 | +NetpCheckIfAccountShouldBeReused: Active Directory Policy check with SAM_DOMAIN_JOIN_POLICY_LEVEL_V2 returned NetStatus:0x0. |
| 66 | +NetpCheckIfAccountShouldBeReused: Account re-use attempt was Denied by Active Directory Policy. |
| 67 | +NetpCheckIfAccountShouldBeReused:fReuseAllowed: FALSE, NetStatus:0x0 |
| 68 | +NetpModifyComputerObjectInDs: Account exists and re-use is blocked by policy. Error: 0xaac |
| 69 | +NetpProvisionComputerAccount: LDAP creation failed: 0xaac |
| 70 | +NetpProvisionComputerAccount: Retrying downlevel per options |
| 71 | +NetpManageMachineAccountWithSid: NetUserAdd on 'ContosoDC1.contoso.com' for 'HOST1$' failed: 0x8b0 |
| 72 | +IsLegacyAccountReuseSetInRegistry: RegQueryValueEx for 'NetJoinLegacyAccountReuse' returned Status: 0x2. |
| 73 | +IsLegacyAccountReuseSetInRegistry returning: 'FALSE''. |
| 74 | +NetpManageMachineAccountWithSid: The computer account already exists in Active Directory.Re-using the account was blocked by security policy. |
| 75 | +NetpProvisionComputerAccount: retry status of creating account: 0xaac |
| 76 | +ldap_unbind status: 0x0 |
| 77 | +NetpJoinCreatePackagePart: status:0xaac. |
| 78 | +NetpJoinDomainOnDs: Function exits with status of: 0xaac |
| 79 | +NetpJoinDomainOnDs: status of disconnecting from '\\ContosoDC1.contoso.com': 0x0 |
| 80 | +NetpResetIDNEncoding: DnsDisableIdnEncoding(RESETALL) on 'contoso.com' returned 0x0 |
| 81 | +NetpJoinDomainOnDs: NetpResetIDNEncoding on 'contoso.com': 0x0 |
| 82 | +NetpDoDomainJoin: status: 0xaac |
| 83 | +``` |
| 84 | + |
| 85 | +### Error detail |
| 86 | + |
| 87 | +|Hexadecimal error|Decimal error|Symbolic error string|Error description|Header| |
| 88 | +|---|---|---|---|---| |
| 89 | +|0x8b0|2224|NERR_UserExists|The account already exists.|lmerr.h| |
| 90 | +|0xaac|2732|NERR_AccountReuseBlockedByPolicy|An account with the same name exists in Active Directory. Re-using the account was blocked by security policy.|lmerr.h| |
| 91 | + |
| 92 | +## Cause |
| 93 | + |
| 94 | +Windows introduced additional protections with updates released on and after October 11, 2022. These protections intentionally prevent domain join operations from reusing an existing computer account in the target domain unless any of the following conditions is met: |
| 95 | + |
| 96 | +- The user attempting the operation is the creator of the existing account. |
| 97 | +- The computer is created by a member of domain administrators, enterprise administrators, or built-in administrators groups. |
| 98 | +- The owner of the computer account object that is being reused is a member of the **Domain controller: Allow computer account reuse during domain join** Group Policy setting. This setting requires the installation of Windows updates released on or after March 14, 2023, on all member computers and domain controllers. |
| 99 | + |
| 100 | +## Resolution |
| 101 | + |
| 102 | +To fix the issue, follow these steps: |
| 103 | + |
| 104 | +1. Perform the join operation by using the same account that created the computer account in the target domain. |
| 105 | +2. If the existing account is stale (unused), delete it before attempting to join the domain again. |
| 106 | +3. Rename the computer and join the domain using a different account that doesn't exist. |
| 107 | +4. If a trusted security principal owns the existing account, and an administrator wants to reuse the account, use the **Domain controller: Allow computer account re-use during domain join** Group Policy. |
| 108 | + |
| 109 | +## Reference |
| 110 | + |
| 111 | +For more information about domain join hardening changes, see [KB5020276—Netjoin: Domain join hardening changes](https://support.microsoft.com/topic/kb5020276-netjoin-domain-join-hardening-changes-2b65a0f3-1f4c-42ef-ac0f-1caaf421baf8). |
0 commit comments