Skip to content

Commit c0c82e1

Browse files
authored
update per reviewer's comments
1 parent 4a6b080 commit c0c82e1

3 files changed

Lines changed: 86 additions & 76 deletions

File tree

support/windows-server/active-directory/error-0x5-access-denied-rename-computer-dc.md

Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
title: Error 0x5 Access Denied When You Rename a Computer That Is Member of a Domain
3+
description: Helps resolve error 0x5 Access Denied when you rename a computer that is member of a domain.
4+
ms.date: 03/21/2025
5+
manager: dcscontentpm
6+
audience: itpro
7+
ms.topic: troubleshooting
8+
ms.reviewer: kaushika, raviks, v-lianna
9+
ms.custom:
10+
- sap:active directory\on-premises active directory domain join
11+
- pcy:WinComm Directory Services
12+
---
13+
# Error 0x5 Access Denied when you rename a computer that is member of a domain
14+
15+
This article helps resolve error 0x5 **Access Denied** when you rename a computer that is member of a domain.
16+
17+
When you check the **NetSetup.log** file, you see the following entries:
18+
19+
```output
20+
NetpChangeMachineName: from 'TESTNAME97' to 'TESTNAME98' using 'ADATUM.COM\test_adm_user' [0x2]
21+
NetpDsGetDcName: trying to find DC in domain 'ADATUM', flags: 0x1010
22+
NetpDsGetDcName: found DC '\\ADATUMDC01' in the specified domain
23+
NetpChangeMachineName: status of connecting to dc '\\ADATUMDC01': 0x0
24+
NetpGetLsaPrimaryDomain: status: 0x0
25+
NetpManageMachineAccountWithSid: status of NetUserSetInfo on '\\ADATUMDC01' for 'TESTNAME97$': 0x5 Access Denied
26+
```
27+
28+
`NetUserSetInfo` targets the domain controller (DC) Security Accounts Manager Server (SAM) server component, which uses the SAM Remote Procedure Call (RPC) function on Server Message Block (SMB) Named Pipes. Here is the complete TCP connection network traffic during the NetSetup failure event, which indicates the failure at a SAM connection:
29+
30+
```output
31+
ADATUMDC01 10.101.56.150 TCP TCP: [Bad CheckSum]Flags=...A..S., SrcPort=Microsoft-DS(445), DstPort=59729, PayloadLen=0, Seq=347025249, Ack=2963325843, Win=8192 (Negotiated scale factor 0x8) = 8192
32+
10.101.56.150 ADATUMDC01 TCP TCP:Flags=...A...., SrcPort=59729, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=2963325843, Ack=347025250, Win=256
33+
...
34+
ADATUMDC01 10.101.56.150 MSRPC MSRPC:c/o Fault: Call=0x2 Context=0x0 Status=0x5 Cancels=0x0 0x5 Access Denied
35+
...
36+
```
37+
38+
In addition, you see the following event in the DC SAM server Event Trace Log (ETL):
39+
40+
```output
41+
[SAMSRV] security_c3857 SampCheckRpcRemoteCallerAccess() - Remote SAM Access is denied in case1 for the client SID:<SID> from network address: <IP Address>
42+
```
43+
44+
## Security policy prevent malicious SAM enumeration
45+
46+
Remote SAM access control was introduced in Windows Server 2016 and Windows 10, version 1607 and later versions as a new security policy to prevent malicious SAM enumeration. Here's the information of the policy:
47+
48+
|Security policy path |Local Security Policy > Security Settings > Local Policies > Security Options |
49+
|---------|---------|
50+
|**Policy** |**Network access: Restrict clients allowed to make remote calls to SAM** |
51+
|**Registry value** |`HKLM\SYSTEM\CurrentControlSet\Control\Lsa\RestrictRemoteSam` |
52+
53+
Only security groups allowed to read for the Remote SAM Remote Procedure Call (RPC) access defined in the policy setting, can set up a SAM connection with the target machine.
54+
55+
This policy setting isn't useful on DCs, because Active Directory objects have their own access control settings, which isn't available for domain members or stand-alone machines with the SAM database.
56+
57+
DCs might have the setting as it stays configured when you promote a member server with this setting to be a DC.
58+
59+
To resolve this issue, you can use one of the following methods:
60+
61+
## Method 1: Define a policy setting for DCs that allows the calls
62+
63+
Set the **Network access: Restrict clients allowed to make remote calls to SAM** policy to allow **Everyone** or **Authenticated Users** and apply it to all DCs.
64+
65+
This will resolve the problem for all DCs, and ensure they all use the same setting.
66+
67+
## Method 2:Delete the registry value RestrictRemoteSam
68+
69+
Delete the registry value to apply the default Security Descriptor Definition Language (SDDL). The default value for DCs means that everyone has read permissions to preserve compatibility. To delete the registry value, run the following command:
70+
71+
```console
72+
reg delete "HKLM\system\currentControlSet\control\lsa" /v restrictRemoteSam /f
73+
```
74+
75+
> [!NOTE]
76+
> This change doesn't require a restart.
77+
78+
A customized SDDL for the policy might result in unexpected failures. Here are some scenarios to be aware of:
79+
80+
- Admin tools, scripts, and software that previously enumerated users, groups, and group memberships might fail.
81+
- Remote Desktop Protocol (RDP) connections to Remote Desktop Services (RDS) Servers fail when the RDS tries to retrieve user details using remote SAM RPC calls.
82+
- Applications that use Authorization (AuthZ) against accounts that are disabled can run into Access Denied errors. For example, Microsoft Exchange Server might encounter this issue during Offline Address Book (OAB) generation checks.
83+
84+
For more information, see [AuthZ fails with an Access Denied error when an application does access checks in Windows Server](../group-policy/authz-fails-access-denied-error-application-access-check.md).

support/windows-server/toc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ items:
357357
href: ./active-directory/cannot-connect-internet-domain.md
358358
- name: Default limit to workstation numbers
359359
href: ./active-directory/default-workstation-numbers-join-domain.md
360-
- name: Error 0x5 Access Denied when you rename a computer in a DC
361-
href: ./active-directory/error-0x5-access-denied-rename-computer-dc.md
360+
- name: Error 0x5 Access Denied when you rename a computer
361+
href: ./active-directory/error-0x5-access-denied-rename-computer.md
362362
- name: Netlogon service doesn't keep settings after in-place upgrade
363363
href: ./active-directory/netlogon-service-not-start-automatically.md
364364
- name: Support boundaries for Active Directory over NAT

0 commit comments

Comments
 (0)