Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (seongtaejeong at gmail.com)
홈페이지
첨부 파일
 

The trust relationship between this workstation and the primary domain failed. - 네 번째 이야기

어느 순간부터 이런 오류가 발생하면서 AD 로그인이 안 됩니다.

The trust relationship between this workstation and the primary domain failed. - 세 번째 이야기
; https://www.sysnet.pe.kr/2/0/12721

재미있는 건, 다시 로그인하라고 뜨는 창에서 정상적으로 입력을 하면 또 로그인이 되긴 합니다. 도대체 무슨 문제일까요? ^^;

그런데, 좀 이상한 점이 있습니다. 2대의 AD 서버(예를 들어, TESTAD1, TESTAD2)에는 모두 DNS 서버가 설치돼 있었는데요, 위의 문제가 발생하는 서버는 네트워크 설정에서 주 DNS 서버가 TESTAD1로 설정돼 있다는 점입니다. 즉, TESTAD2가 주 DNS 서버로 설정된 PC에서는 AD 로그인이 아주 매끄럽게 진행됩니다.

일례로, 아래는 (TESTAD2를 주 DNS로 설정한) 정상적인 상황에서의 진단 결과인데요,

C:\Users\Administrator> nltest /sc_query:testad.com
Flags: 30 HAS_IP  HAS_TIMESERV  Authentication Service: Netlogon
Trusted DC Name \\TESTAD2.testad.com
Trusted DC Connection Status Status = 0 0x0 NERR_Success
The command completed successfully

PS C:\Users\Administrator> Test-ComputerSecureChannel
True

PS C:\Users\Administrator> Get-WmiObject Win32_ComputerSystem | Select Domain7

Domain
------
testad.com

C:\Users\Administrator> nslookup testad.com
Server:  UnKnown
Address:  192.168.100.60

Name:    testad.com
Addresses:  192.168.100.60
          192.168.100.50

C:\WINDOWS\system32> gpupdate
Updating policy...

Computer Policy update has completed successfully.
User Policy update has completed successfully.

그렇지 않은 상황에서는 이런 식의 오류가 발생했습니다.

PS C:\Users\Administrator> Reset-ComputerMachinePassword
Reset-ComputerMachinePassword: Cannot reset the secure channel password for the computer account in the domain. Operation failed with the following exception: The user name or password is incorrect.
.

PS C:\Users\Administrator> Test-ComputerSecureChannel -Repair -Credential (Get-Credential)

PowerShell credential request
Enter your credentials.
User: testad\testusr
Password for user testad\testusr: ***************

Test-ComputerSecureChannel: Cannot reset the secure channel password for the computer account in the domain. Operation failed with the following exception: A local error has occurred.

C:\Windows\system32> nltest /sc_query:testad.com
Flags: 0
Trusted DC Name
Trusted DC Connection Status Status = 1311 0x51f ERROR_NO_LOGON_SERVERS
The command completed successfully

// 또는 ERROR_ACCESS_DENIED

C:\WINDOWS\System32> nltest /sc_query:testad.com
Flags: 0 Authentication Service: Netlogon
Trusted DC Name
Trusted DC Connection Status Status = 5 0x5 ERROR_ACCESS_DENIED
The command completed successfully

C:\Windows\system32> gpupdate
Updating policy...

Computer policy could not be updated successfully. The following errors were encountered:

The processing of Group Policy failed because of lack of network connectivity to a domain controller. This may be a transient condition. A success message would be generated once the machine gets connected to the domain controller and Group Policy has successfully processed. If you do not see a success message for several hours, then contact your administrator.
User Policy could not be updated successfully. The following errors were encountered:

The processing of Group Policy failed because of lack of network connectivity to a domain controller. This may be a transient condition. A success message would be generated once the machine gets connected to the domain controller and Group Policy has successfully processed. If you do not see a success message for several hours, then contact your administrator.

To diagnose the failure, review the event log or run GPRESULT /H GPReport.html from the command line to access information about Group Policy results.

C:\Windows\system32> nslookup testad.com
Server:  UnKnown
Address:  192.168.100.50

*** UnKnown can't find testad.com: Non-existent domain




그리하여, DNS 서버에 문제가 있을 것 같은 TESTAD1에 로그인해서 "DNS Manager" 콘솔을 실행했는데 이런 오류가 발생합니다.

DNS
---------------------------
The server TESTAD1 could not be contacted.

The error was:

Access was denied.

Would you like to add it anyway?

분명히 서비스 관리자에 보면 DNS 서비스가 "Running" 상태로 떠 있는데도 불구하고 저런 오류가 발생하는 것입니다. 게다가 "DNS Manager" 콘솔에 추가된 해당 서버를 우클릭해도 "Configure a DNS Server" 메뉴가 비활성화돼 있어 더 할 수 있는 방법이 없습니다.

혹시나 싶어 TESTAD2 서버로부터 AD 정보를 동기화하려고 했더니 이런 오류까지 발생합니다.

Replicate Now
---------------------------
The following error occurred during the attempt to contact the Domain Controller TESTAD2:

The target principal name is incorrect.

또는, "Active Directory Sites and Services" MMC를 이용해 "Replicate configuration from the selected DC" 또는 "Replcate configuration to the selected DC" 메뉴를 선택하면 이런 식으로 오류 메시지가 나옵니다.

Replicate Now
---------------------------
The following error occurred during the attempt to contact the Domain Controller TESTAD2:

The RPC server is unavailable.

This condition may be caused by a DNS lookup problem. For information about troubleshooting common DNS lookup problems, please see the following Microsoft Web site:

http://go.microsoft.com/fwlink/?LinkId=5171

명령행으로 직접 실행해도 마찬가지인데요,

C:\Windows\System32> repadmin /syncall /AdeP
Syncing all NC's held on TESTAD1.
Syncing partition: DC=DomainDnsZones,DC=testad,DC=com
CALLBACK MESSAGE: Error contacting server CN=NTDS Settings,CN=TESTAD2,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=testad,DC=com (network error): -2146893022 (0x80090322):
    The target principal name is incorrect.
CALLBACK MESSAGE: Error contacting server CN=NTDS Settings,CN=TESTAD1,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=testad,DC=com (network error): -2146893022 (0x80090322):
    The target principal name is incorrect.

SyncAll exited with fatal Win32 error: 8440 (0x20f8):
    The naming context specified for this replication operation is invalid.

즉, 이 모든 것은 AD 동기화가 제대로 되지 않아 발생한 문제였던 것입니다.




우선, 저 문제를 직접적으로는 해결할 수 없었고 Domain Admins에 해당하는 계정을 별도로 하나 더 생성해 봤는데요, 이후 문제가 있던 TESTAD1 서버에 (RDP가 아닌 콘솔로) 새롭게 생성한 AD 계정으로 로그인 시도를 해봤습니다. 일단 로그인은 성공한 듯하지만 검은 화면에서 더 이상 진행이 안됐습니다. 재미있는 건, 이 상태에서 RDP로 이전 Domain Admins 계정으로 로그인했더니 그 세션에서는 repadmin 명령어가 잘 동작했습니다.

안전을 위해, TESTAD1과 TESTAD2 모두에서 "repadmin /syncall /AdeP" 명령어를 실행한 다음 "TESTAD1" AD 서버에 새롭게 생성했던 로그인 계정까지 동기화가 되는 것을 확인한 다음 (필요 없는 절차일 듯하지만) 재부팅하는 걸로 마무리했습니다.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 6/7/2025]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 16  17  18  19  20  21  22  23  24  25  26  27  28  [29]  30  ...
NoWriterDateCnt.TitleFile(s)
13240정성태2/1/202312729디버깅 기술: 187. ASP.NET Web Application (.NET Framework) 프로젝트의 숨겨진 예외 - System.Web.HttpException
13239정성태2/1/202311286디버깅 기술: 186. C# - CacheDependency의 숨겨진 예외 - System.Web.HttpException
13238정성태1/31/202316285.NET Framework: 2092. IIS 웹 사이트를 TLS 1.2 또는 TLS 1.3 프로토콜로만 운영하는 방법
13237정성태1/30/202315066.NET Framework: 2091. C# - 웹 사이트가 어떤 버전의 TLS/SSL을 지원하는지 확인하는 방법
13236정성태1/29/202314314개발 환경 구성: 663. openssl을 이용해 인트라넷 IIS 사이트의 SSL 인증서 생성
13235정성태1/29/202313840개발 환경 구성: 662. openssl - 윈도우 환경의 명령행에서 SAN 적용하는 방법
13234정성태1/28/202316451개발 환경 구성: 661. dnSpy를 이용해 소스 코드가 없는 .NET 어셈블리의 코드를 변경하는 방법 [1]
13233정성태1/28/202316987오류 유형: 840. C# - WebClient로 https 호출 시 "The request was aborted: Could not create SSL/TLS secure channel" 예외 발생
13232정성태1/27/202312959스크립트: 43. uwsgi의 --processes와 --threads 옵션
13231정성태1/27/202311897오류 유형: 839. python - TypeError: '...' object is not callable
13230정성태1/26/202312965개발 환경 구성: 660. WSL 2 내부로부터 호스트 측의 네트워크로 UDP 데이터가 1개의 패킷으로만 제한되는 문제
13229정성태1/25/202315187.NET Framework: 2090. C# - UDP Datagram의 최대 크기
13228정성태1/24/202315859.NET Framework: 2089. C# - WMI 논리 디스크가 속한 물리 디스크의 정보를 얻는 방법 [2]파일 다운로드1
13227정성태1/23/202314629개발 환경 구성: 659. Windows - IP MTU 값을 바꿀 수 있을까요? [1]
13226정성태1/23/202313087.NET Framework: 2088. .NET 5부터 지원하는 GetRawSocketOption 사용 시 주의할 점
13225정성태1/21/202312935개발 환경 구성: 658. Windows에서 실행 중인 소켓 서버를 다른 PC 또는 WSL에서 접속할 수 없는 경우
13224정성태1/21/202313028Windows: 221. Windows - Private/Public/Domain이 아닌 네트워크 어댑터 단위로 방화벽을 on/off하는 방법
13223정성태1/20/202312704오류 유형: 838. RDP 연결 오류 - The two computers couldn't connect in the amount of time allotted
13222정성태1/20/202312702개발 환경 구성: 657. WSL - DockerDesktop.vhdx 파일 위치를 옮기는 방법
13221정성태1/19/202313055Linux: 57. C# - 리눅스 프로세스 메모리 정보파일 다운로드1
13220정성태1/19/202313177오류 유형: 837. NETSDK1045 The current .NET SDK does not support targeting .NET ...
13219정성태1/18/202312419Windows: 220. 네트워크의 인터넷 접속 가능 여부에 대한 판단 기준
13218정성태1/17/202312308VS.NET IDE: 178. Visual Studio 17.5 (Preview 2) - 포트 터널링을 이용한 웹 응용 프로그램의 외부 접근 허용
13217정성태1/13/202312996디버깅 기술: 185. windbg - 64비트 운영체제에서 작업 관리자로 뜬 32비트 프로세스의 덤프를 sos로 디버깅하는 방법
13216정성태1/12/202312551디버깅 기술: 184. windbg - 32비트 프로세스의 메모리 덤프인 경우 !peb 명령어로 나타나지 않는 환경 변수
13215정성태1/11/202315970Linux: 56. 리눅스 - /proc/pid/stat 정보를 이용해 프로세스의 CPU 사용량 구하는 방법 [1]
... 16  17  18  19  20  21  22  23  24  25  26  27  28  [29]  30  ...