Monday, October 23, 2017

 

[ActiveDirectory] ntdsutil을 통한 Orphaned Domain 삭제



ntdsutil을 통한 Orphaned Domain 삭제




[Explanation]

1Forest-MultiDomain 환경에서 Orphanded 된 도메인을 삭제하는 과정 입니다. 전체적으로 살펴보면 우선 nsdsutil을 통해서 정보를 삭제하고 DNS를 삭제하고 추후 ActiveDirectory Domain & Trust에 있는 garbage 정보를 삭제하기 위해서 강제로 다시 ntdsutil을 이용하는 과정을 다루고 있습니다. 

 1.     CDC에서 강제로 dcpromo /forceremoval을 수행하여 해당 서버는 workgroup 상태가 되었지만, PDC에서 확인 결과 Active Directory Domain and Trust LHA-IDC 사이트 및 DC LHASCCDC01V 가 남아있습니다.

2.     Ntdsutil Metadata Cleanup 명령어를 통해 LHA-IDC 사이트 및 LHASCCDC01V 정보를 제거합니다.
Ntdsutil
Metadata cleanup
Connections
Connect to server PDC이름
Quit
Select operation target
List domains
Select domain 제거하고자 하는 도메인 번호
List sites
Select site 제거하고자 하는 사이트 번호
List servers in site
Select server 제거하고자 하는 서버 번호
Quit

Remove selected server





3.     NTDSUtil 을 이용한 Metadata cleanup 이 진행 된 후 Active Directory Site and Service 에서 LHA-IDC 사이트의 서버의 NTDS Settings 정보가 제거하였습니다.

4.     Active Directory Site and Server 에 남아 있는 LHASCCDC01V 서버와 Servers, LHA-IDC 사이트를 수동으로 제거하였습니다.

5.     DNS 관리 콘솔에서 LHASCCDC01V SRV 레코드를 삭제합니다.

6.     Active Directory Domain and Trust 에는 LHA-IDC 정보가 남아 있고 repadmin /syncall 실행 시 아직 해당 정보가 남아 있는 상태 입니다.



7.     Active Directory Domain and Trust 에서 LHA.LGCloud.com 정보는 아래 방법으로 제거를 시도합니다. 
a.     명령 프롬프트를 관리자 권한으로 실행 합니다.
b.     다음 순서로 명령어를 입력 합니다.
Ntdsutil
Activate instance ntds
Metadata cleanup
Connections
Connect to server localhost
Q
Q
Partition management
List
c.     Partition List LHA.LGCloud.com NC 를 다음과 같이 명령어를 실행 해서 제거 합니다.
Delete nc DC=DomainDnsZones,DC=LHA,DC=LGCloud,DC=com  ß List 명령어 중 LHA.LGCloud.com 도메인 관련된 NC 목록을 확인 해서 하나의 NC 씩 제거 합니다. 
d.     위 명령어 실행이 완료 된 후 Active Directory Domain and Trust 에서 LHA.LGCloud.com 도메인이 제거 되었는지 확인 합니다.
C:\Windows\system32>ntdsutil
ntdsutil: activate instance ntds
Active instance set to "ntds".
ntdsutil: metadata cleanup
metadata cleanup: connections
server connections: connect to server localhost
Binding to localhost ...
Connected to localhost using credentials of locally logged on user.
server connections: q
metadata cleanup: q
ntdsutil: partition management
partition management: list
Note: Directory partition names with International/Unicode characters will only display correctly if appropriate fonts and language support are loaded
Found 29 Naming Context(s)
0 - CN=Configuration,DC=Contoso,DC=com
1 - CN=Schema,CN=Configuration,DC=Contoso,DC=com
2 - DC=Contoso,DC=com
3 - DC=DomainDnsZones,DC=Contoso,DC=com
4 - DC=ForestDnsZones,DC=Contoso,DC=com
5 - DC=1,DC=Contoso,DC=com
6 - DC=DomainDnsZones,DC=1,DC=Contoso,DC=com
7 - DC=2,DC=Contoso,DC=com
8 - DC=DomainDnsZones,DC=2,DC=Contoso,DC=com
9 - DC=3,DC=Contoso,DC=com
10 - DC=DomainDnsZones,DC=3,DC=Contoso,DC=com
11 - DC=4,DC=Contoso,DC=com
12 - DC=DomainDnsZones,DC=4,DC=Contoso,DC=com
13 - DC=5,DC=Contoso,DC=com
14 - DC=DomainDnsZones,DC=5,DC=Contoso,DC=com
15 - DC=6,DC=Contoso,DC=com
16 - DC=DomainDnsZones,DC=6,DC=Contoso,DC=com
17 - DC=7,DC=Contoso,DC=com
18 - DC=DomainDnsZones,DC=7,DC=Contoso,DC=com
19 - DC=8,DC=Contoso,DC=com
20 - DC=DomainDnsZones,DC=8,DC=Contoso,DC=com
21 - DC=9,DC=Contoso,DC=com
22 - DC=DomainDnsZones,DC=9,DC=Contoso,DC=com
23 - DC=10,DC=Contoso,DC=com
24 - DC=DomainDnsZones,DC=10,DC=Contoso,DC=com
25 - DC=LHA,DC=Contoso,DC=com
26 - DC=DomainDnsZones,DC=LHA,DC=Contoso,DC=com

27 - DC=11,DC=Contoso,DC=com
28 - DC=DomainDnsZones,DC=11,DC=Contoso,DC=com
partition management: Delete nc DC=DomainDnsZones,DC=LHA,DC=Contoso,DC=com
The operation was successful. The partition has been marked for removal from the enterprise. It will be removed over time in the background.
Note: Please do not create another partition with the same name until the servers which hold this partition have had an opportunity to remove it. This will occur when knowledge of the deletion of this partition has replicated throughout the forest, and the servers which held the partition have removed all the objects within that partition. Complete removal of the partition can be verified by consulting the Directory event log on each server.
partition management: Delete nc DC=LHA,DC=Contoso,DC=com              The operation was successful. The partition has been marked for removal from the enterprise. It will be removed over time in the background.
Note: Please do not create another partition with the same name until the servers which hold this partition have had an opportunity to remove it. This will occur when knowledge of the deletion of this partition has replicated throughout the forest, and the servers which held the partition have removed all the objects within that partition. Complete removal of the partition can be verified by consulting the Directory event log on each server.
partition management: list 
Note: Directory partition names with International/Unicode characters will only display correctly if appropriate fonts and language support are loaded
Found 27 Naming Context(s)
0 - CN=Configuration,DC=Contoso,DC=com
1 - CN=Schema,CN=Configuration,DC=Contoso,DC=com
2 - DC=Contoso,DC=com
3 - DC=DomainDnsZones,DC=Contoso,DC=com
4 - DC=ForestDnsZones,DC=Contoso,DC=com
5 - DC=1,DC=Contoso,DC=com
6 - DC=DomainDnsZones,DC=1,DC=Contoso,DC=com
7 - DC=2,DC=Contoso,DC=com
8 - DC=DomainDnsZones,DC=2,DC=Contoso,DC=com
9 - DC=3,DC=Contoso,DC=com
10 - DC=DomainDnsZones,DC=3,DC=Contoso,DC=com
11 - DC=4,DC=Contoso,DC=com
12 - DC=DomainDnsZones,DC=4,DC=Contoso,DC=com
13 - DC=5,DC=Contoso,DC=com
14 - DC=DomainDnsZones,DC=5,DC=Contoso,DC=com
15 - DC=6,DC=Contoso,DC=com
16 - DC=DomainDnsZones,DC=6,DC=Contoso,DC=com
17 - DC=7,DC=Contoso,DC=com
18 - DC=DomainDnsZones,DC=7,DC=Contoso,DC=com
19 - DC=8,DC=Contoso,DC=com
20 - DC=DomainDnsZones,DC=8,DC=Contoso,DC=com
21 - DC=9,DC=Contoso,DC=com
22 - DC=DomainDnsZones,DC=9,DC=Contoso,DC=com
23 - DC=10,DC=Contoso,DC=com
24 - DC=DomainDnsZones,DC=10,DC=Contoso,DC=com
25 - DC=11,DC=Contoso,DC=com
26 - DC=DomainDnsZones,DC=11,DC=Contoso,DC=com
partition management: q
ntdsutil: q


이후 정상적으로 Active Directory Domain and Trust에서 해당 Domain이 삭제되고 복제 대상에서 제외됨을 확인하였습니다. 


♔♔♔♔♔♔♔♔♔♔

댓글이나 의견은 언제든지 환영합니다.

Your Comments are Always Welcome!
Share:

0 comments:

Post a Comment