跳至主要內容

Active Directory Metadata Cleanup

Active Directory Metadata Cleanup

Sometimes it can/will happen that a correct removal from a Domain Controller isn’t possible because of a hardware crash, you have to force the removal of a DC or the previous admin have left some “garbage” for you.

So you have to do a metadata cleanup, otherwise all other DCs will try to replicate with that machine, as they are “thinking” this Domain Controller still exists, which fills also the event viewer with not wanted error messages. Additional the support tools dcdiag and repadmin or replmon will report problems.

The metadata cleanup can be done with NTDSUTIL for the AD database part according to:

How to remove data in Active Directory after an unsuccessful domain controller demotion

The above article applies to all Windows versions starting with Windows 2000 Server up to Windows Server 2008 R2.

There can also be the situation that the FSMO roles must be seized as the not longer existing DC was the owner of them:

Using Ntdsutil.exe to transfer or seize FSMO roles to a domain controller

---------------------------------------------------------------------------------------------------------

With the RSAT (Remote Server Administration Tools or DSA.MSC) coming with Windows Server 2008 or Windows Server 2008 R2, there is also the option to remove a DC from AD Users and Computers or AD Sites and Services which also triggers the metadata cleanup.

To remove a RWDC with AD UC:

- therefore right click the RWDC in question and choose the DELETE option



- an additional popup will inform you, that the DC isn’t demoted with dcpromo and you have to choose the checkmark to accept that normal removal isn’t possible anymore



- after accepting the above popup you will be informed if the Domain Controller is also Global catalog server, (make sure other GCs exist in the domain)



- you have again to accept the deletion message to go on

- now the last possible popup option can occur, if the DC is also FSMO roles holder you will be prompted to accept the move to another DC of the FSMO roles



- in AD sites and services remove the NTDS Settings, also cleanup all DNS zones from CNAME and server records and the DNS server properties, Name server tab.



To remove a RODC with AD UC:

- therefore right click the RODC in question and choose the DELETE option



- now the option will be offered to reset all user passwords (requires a new password for a user), computer passwords (requires to re-add the computer to the domain), additional you can view/export the on the RODC saved user accounts and computer accounts. This option will NOT be offered if you work with NTDSUTIL.



- you will see now an overview with the chosen options to accept



- after accepting the above popup you will be informed if the Domain Controller is also Global catalog server, (make sure other GCs exist in the domain)



- in AD sites and services remove the NTDS Settings, DNS cleanup isn’t needed for a RODC, this is done automatically

For removal of a RWDC or RODC from AD Sites and Services you have to choose the NTDS Settings object to delete and after this step delete the DC.

留言

此網誌的熱門文章

XCOPY 指令教學!

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z]\r\r [/EXCLUDE:file1[+file2][+file3]...] source 指定要複製的檔案。 destination 指定位置或者/以及新檔案的名稱。 /A 只複製設定成保存屬性的檔案,不要改變屬性的設定。 /M 只複製設定成保存屬性的檔案,並清除保存屬性。 /D:m-d-y 複製在指定日期當天或之後發生變更的檔案。如果沒有給日期, 只複製那些來源檔案日期比目的檔案日期為新的檔案。 /EXCLUDE:file1[+file2][+file3]... 指定檔案清單字串。每個字串 應該在檔案中的不同行。如果有字串對應到要進行複製的檔案絕 對路徑的任何部分,這個檔案會被排除複製。例如,指定字串 \obj\ 或 .obj 的話,會排除所有在 obj 目錄下副檔名是 .obj 的檔案複製。 /P 在建立每個目的檔案時顯示提示。 /S 複製每個目錄及其包含的子目錄,不複製空目錄。 /E 複製每個目錄及其包含的子目錄,也複製空目錄。/S 與 /E 相同,能夠用來修改 /T。 /V 驗證每個新檔案。 /W 在複製之前提示您按鍵繼續。 /C 如果錯誤發生時也繼續複製。 /I 如果目的不存在且複製一個以上的檔案的話,就假設指定的 目的一定是目錄。 /Q 在複製時不要顯示檔名。 /F 在複製時顯示來源及目的檔案的全部檔名。 /L 顯示要複製的檔案。 /G 允許加密檔案複製到不支援加密的 目的地。 /H 時複製隱藏檔和系統檔。 /R 覆蓋唯讀檔案。 /T 建立目錄結構,但不複製其中的檔案。不包括空目錄及子目錄。 /T /E 會包括空目錄及子目錄。 /U 只複製已經存在目的位置的檔案。 /K 複製檔案屬性。通常 Xcopy 會重設唯讀的屬性。 /N 用所產生的短檔名來進行複製。 /O 複製檔案所有權及 ACL 資訊。 /X 複製檔案審查設定 (包含 /O)。 /Y 不要提示您確認是否要覆蓋一個已經存在的檔案。 /-Y 示您確認是否要覆蓋一個已經存在的檔案。 ...

讓proftpd支援ie當ftp client

讓proftpd支援ie當ftp client 因為ie是非正規ftp client, 如果proftpd本身就是utf-8為預設編碼, 那用ie上傳的檔案會全部變亂碼, 還好proftpd自1.3.2起支援了UseEncoding(mod_lang.c) , 所以只要在架設完成後, 在proftpd.conf裡加上: LangEngine on #IfModule mod_lang.c# UseEncoding utf-8 big5 #/IfModule# # = 就可以讓ie成功上傳而不產生亂碼

[Rsync]Windows Client 備份到遠端 Ubuntu(Linux) Rsync伺服器分享

1.請先參考[Cwrsync for windows教學(需要密碼)]安裝Client端的設定,參考下面的Client端安裝方式,因為我們的Server不是Windows了換成Linux Rsync伺服器 2.參考[Rsync Server安裝與設定]安裝好Rsync套件,並加入密碼檔 3.接者編輯windows client 安裝cwrsync的目錄下[cwrsync.cmd]檔案,輸入以下的文字 rsync -arHz --password-file=/cygdrive/e/data/cwRsync/rsyncd.secrets /cygdrive/D/adonis/ adonis@rsync.adc.com.tw::myData --password-file=/cygdrive/e/rsyncd.txt 可以用 Server (LINUX)上的password file 要 chown root:root rsyncd.secrets 及chmod 600 rsyncd.secrets Client (WIN)上的password file 要用c:\program files\cwRsync\bin\ 的chown administrator rsyncd.txt及 chmod -c 600 rsyncd.txt 說明: (1)--password-file=/cygdrive/e/data/cwRsync/rsyncd.secrets ===>密碼檔放置的位置 (2)adonis@rsync.adc.com.tw::myData ===> 使用adonis認證上傳到rsync.abc.com.tw伺服器上 (3)rsyncd.secrets ==>只要輸在在Server端上的所建立使用者的密碼就可以囉,如:123456 4.到DOS視窗點cwrsync.cmd,就可以上傳資料囉。 注意:這台是XP所以沒有問題可以上傳,但是如果你是windows server時會出現錯誤訊息,解決方式就可以參考我的另一篇解決方法 [cwrsync password file must be owned by root when running as root]