跳至主要內容

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成功上傳而不產生亂碼

dd-wrt 作為openvpn server

dd-wrt的韌體除了可以使用pptp作為 vpn server之外,也可以作為openvpn server。設定上跟pptp的設定有所不同,稍微複雜了點,不過費點心思還是可以順利達成的。 安裝的方式在dd-wrt wiki有詳細的說明,不過這裡還是做個簡單的筆記。 當使用opennvpn的時候先關閉NAT的功能。 wrt54gs 安裝 openvpn server筆記 首先更新韌體為dd-wrt v23 sp2, 在windows下安裝openvpn gui程式,然後開始製作static.key檔案。 製作的方法,開啟cmd 鍵入 openvpn --genkey --secret static.key 會在目錄下出現一個static.key的檔案,檔案請好好保存。 接著登入AP 連到administrator的頁面,進入command視窗 首先輸入防火牆的設定,開啟需要使用的PORT 在command shell 下輸入 iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT 接著按下 save firewall 此範例是開啟port 443,可以根據自己的需求再更動。 接著設定openvpn 同樣在command shell輸入以下的字串 openvpn --mktun --dev tap0 brctl addif br0 tap0 ifconfig tap0 0.0.0.0 promisc up echo " -----BEGIN OpenVPN Static key V1----- ...INSERT YOUR OWN CONTENT HERE... -----END OpenVPN Static key V1----- " > /tmp/static.key ln -s /usr/sbin/openvpn /tmp/myvpn /tmp/myvpn --dev tap0 --secret /tmp/static.key --comp-lzo --port 443 --proto tcp-server --verb 3 --daemon 在insert your own contene here那一行 把之前在windows下製作的 static.key的內容 拷貝替換。 接著按下 sav...