安裝 Windows Server 2012 Active Directory 唯讀網域控制站 (RODC) (等級 200)

適用於:Windows Server 2022、Windows Server 2019、Windows Server 2016、Windows Server 2012 R2、Windows Server 2012

本文說明如何建立暫存的 RODC 帳戶,並在 RODC 安裝期間將伺服器連結至該帳戶。 本文也說明如何不透過執行階段式安裝來安裝 RODC。

RODC 工作流程階段

階段式唯讀網域控制站 (RODC) 安裝分成兩個不同的階段:

  1. 執行未使用的電腦帳戶

  2. 在升級期間將 RODC 連結至該帳戶

下圖說明使用 Active Directory 管理中心 (Dsac.exe) 在網域中建立空白的 RODC 電腦帳戶的 Active Directory 網域服務唯讀網域控制站暫存處理程序。

Diagram showing the Active Directory Domain Services Read-Only Domain Controller staging process described above.

暫存 RODC Windows PowerShell

ADDSDeployment Cmdlet 引數 (粗體 的引數是必要的。斜體 的引數可以使用 Windows PowerShell 或 [AD DS 設定精靈] 來指定。)
Add-addsreadonlydomaincontrolleraccount -SkipPreChecks

-DomainControllerAccountName

-DomainName

-SiteName

-AllowPasswordReplicationAccountName

-Credential

-DelegatedAdministratorAccountName

-DenyPasswordReplicationAccountName

-NoGlobalCatalog

-InstallDNS

-ReplicationSourceDC

注意

當您不是以 Domain Admins 群組成員的身分登入時,才需要 -credential 引數。

連結 RODC 工作流程

下圖說明 Active Directory 網域服務設定流程,而您已安裝 AD DS 角色、執行 RODC 帳戶並已使用伺服器管理員啟動 [將此伺服器升級為網域控制站] 以在現有的網域中建立新的 RODC,並將其連結至執行的電腦帳戶。

Diagram showing the Active Directory Domain Services configuration process described above.

連結 RODC Windows PowerShell

ADDSDeployment Cmdlet 引數 (粗體 的引數是必要的。斜體 的引數可以使用 Windows PowerShell 或 [AD DS 設定精靈] 來指定。)
Install-AddsDomaincontroller -SkipPreChecks

-DomainName

-SafeModeAdministratorPassword

-ApplicationPartitionsToReplicate

-CreateDNSDelegation

-Credential

-CriticalReplicationOnly

-DatabasePath

-DNSDelegationCredential

-InstallationMediaPath

-LogPath

-Norebootoncompletion

-ReplicationSourceDC

-SystemKey

-SYSVOLPath

-UseExistingAccount

注意

當您不是以 Domain Admins 群組成員的身分登入時,才需要 -credential 引數。

預備

Screenshot of the Active Directory Administrative Center showing the Pre-create a Read-only domain controller account option highlighted in the Tasks pane.

開啟 [Active Directory 管理中心] (Dsac.exe) 以執行唯讀網域控制站電腦帳戶的執行操作 。 選取瀏覽窗格中的網域名稱。 按兩下管理清單中的 [網域控制站] 。 選取工作窗格中的 [預先建立唯讀網域控制站帳戶]

如需 Active Directory 管理中心的詳細資訊,請參閱使用 Active Directory 管理中心的進階 AD DS 管理 (等級 200) 並檢閱 Active Directory 管理中心:使用者入門

如果您曾經建立過唯讀網域控制站,您會發現安裝精靈的圖形化介面和從 Windows Server 2008 使用舊版 [Active Directory 使用者和電腦] 嵌入式管理單元時所見的相同,並且使用相同的程式碼,其中包括匯出過時的 dcpromo 所使用的自動安裝檔案格式中的設定。

Windows Server 2012 使用新的 ADDSDeployment Cmdlet 以暫存 RODC 電腦帳戶,但精靈不會使用該 Cmdlet 來執行作業。 下列各節顯示對等的 Cmdlet 與引數,讓彼此關聯的資訊更易於了解。

Active Directory 管理中心的工作窗格中的 [預先建立唯讀網域控制站帳戶] 連結,相當於 ADDSDeployment Windows PowerShell Cmdlet:

Add-addsreadonlydomaincontrolleraccount

歡迎使用

Screenshot of the Welcome page of the Azure Directory Domain Services Installation Wizard showing the Use advanced mode installation option selected.

[歡迎使用 Active Directory 網域服務安裝精靈] 對話方塊有一個名為 [使用進階模式安裝] 的選項。 選取此選項,然後選取 [下一步] 會顯示密碼複寫原則選項。 清除此選項可使用密碼複寫原則選項的預設值 (本節稍後將進一步詳細探討)。

網路認證

Screenshot of the Network Credentials page of the Azure Directory Domain Services Installation Wizard.

[網路認證] 對話方塊中的網域名稱選項會顯示 Active Directory 管理中心預設的目標網域。 預設會使用您目前的認證。 如果它們未包含 Domain Admins 群組中的成員資格,請按一下 [備用認證],再選取 [設定] ,以提供精靈屬於 Domain Admins 成員的使用者名稱密碼。

對等的 ADDSDeployment Windows PowerShell 引數為:

-credential <pscredential>

請記住,暫存系統是 Windows Server 2008 R2 的直接連接埠,並不提供新的 Adprep 功能。 如果您計劃部署執行的 RODC 帳戶,您必須先在該網域部署未暫存的 RODC 以使自動 rodcprep 作業執行,或是先手動執行 adprep.exe /rodcprep。

否則,您會收到錯誤。 您無法在此網域中安裝唯讀網域控制站,因為 adprep /rodcprep 尚未執行。

Screenshot of the warning message of the Azure Directory Domain Services Installation Wizard stating that adprep /rodcprep was not yet run.

指定電腦名稱

Screenshot of the Specify the Computer Name page of the Azure Directory Domain Services Installation Wizard.

[指定電腦名稱] 對話方塊會要求您輸入不存在的網域控制站的單一標籤 [電腦名稱] 。 您設定的網域控制站和稍後連結至此帳戶的網域控制站必須是相同名稱,否則升級作業將無法偵測暫存的帳戶。

對等的 ADDSDeployment Windows PowerShell 引數為:

-domaincontrolleraccountname <string>

選取站台

Screenshot of the Select a Site page of the Azure Directory Domain Services Installation Wizard.

[選取站台] 對話方塊會顯示目前樹系的 Active Directory 站台清單。 執行的唯讀網域控制站作業會要求您從清單中選取一個站台。 RODC 會使用此資訊在設定磁碟分割中建立其 NTDS 設定物件,然後在部署後第一次啟動時自行加入正確的網站。

對等的 ADDSDeployment Windows PowerShell 引數為:

-sitename <string>

其他網域控制站選項

Screenshot of the Specify the Domain Controller Options page of the Azure Directory Domain Services Installation Wizard.

[其他網域控制站選項] 對話方塊可讓您指定網域控制站執行為 [DNS 伺服器] 和包含 [通用類別目錄] 。 Microsoft 建議唯讀網域控制站提供 DNS 與 GC 服務,因此預設會安裝這兩者;使用 RODC 角色的意義是,在分公司案例中,廣域網路可能無法使用,而若沒有這些 DNS 和通用類別目錄服務,分公司中的電腦將無法使用 AD DS 資源及功能。

[唯讀網域控制站 (RODC)] 是預先選取的選項,而且無法停用。 對等的 ADDSDeployment Windows PowerShell 引數為:

-installdns <string>
-NoGlobalCatalog <{$true | $false}>

注意

依照預設,–NoGlobalCatalog 值為 $false,這表示如果未指定此引數,網域控制站將會是全域通用類別目錄伺服器。

指定密碼複寫原則

Screenshot of the Specify the Password Replication policy page of the Azure Directory Domain Services Installation Wizard.

[指定密碼複寫原則] 對話方塊可讓您修改允許在此唯讀網域控制站上快取其密碼的預設帳戶清單。 在清單中設定為 [拒絕] 或不在清單 (隱含) 的帳戶則無法快取其密碼。 不允許在 RODC 上快取密碼且無法連線可寫入網域控制站並驗證其身分的帳戶,無法存取 Active Directory 所提供的資源或功能。

重要

只有當您在歡迎畫面上選取 [使用進階模式安裝] 核取方塊時,精靈才會顯示這個對話方塊。 如果您清除此核取方塊,精靈會使用下列預設群組和值:

  • Administrators - 拒絕
  • Server Operators - 拒絕
  • Backup Operators - 拒絕
  • Account Operators - 拒絕
  • 拒絕的 RODC 密碼複寫群組 - 拒絕
  • 允許的 RODC 密碼複寫群組 - 允許

對等的 ADDSDeployment Windows PowerShell 引數為:

-allowpasswordreplicationaccountname <string []>
-denypasswordreplicationaccountname <string []>

Screenshot of the Add Groups, Users and Computers dialog box.

RODC 安裝與管理的委派

Screenshot of the Delegation of RODC Installation and Administration page of the Azure Directory Domain Services Installation Wizard.

[RODC 安裝與管理的委派] 對話方塊可讓您設定使用者或設定包含可將伺服器連結至 RODC 電腦帳戶的群組。 選取 [設定] 以瀏覽網域的使用者或群組。 在此對話方塊中指定的使用者或群組會獲得 RODC 的本機系統管理權限。 指定的使用者或指定群組的成員可以相當於電腦 Administrators 群組的權限,在 RODC 上執行作業。 他們不是 Domain Admins 群組的成員或網域內建的 Administrators 群組的成員。

使用這個選項可委派分公司的管理工作,而不需要將分公司系統管理員成員資格授與 Domain Admins 群組。 委派 RODC 管理工作不是必要的。

對等的 ADDSDeployment Windows PowerShell 引數為:

-delegatedadministratoraccountname <string>

摘要

Screenshot of the Summary page of the Azure Directory Domain Services Installation Wizard.

[摘要] 對話方塊可讓您確認您的設定。 這是在精靈建立執行帳戶前可停止安裝的最後機會。 當您準備好建立暫存的 RODC 電腦帳戶時,選取 [下一步]。 選取 [匯出設定] 可以過時的 dcpromo 自動安裝檔案格式儲存回應檔案。

建立

Screenshot of the progress page of the Azure Directory Domain Services Installation Wizard.

[Active Directory 網域服務安裝精靈] 會在 Active Directory 中建立執行的唯讀網域控制站。 這項作業開始之後,即無法將其取消。

Screenshot of the last page of the Azure Directory Domain Services Installation Wizard.

使用下列 Cmdlet 可利用 ADDSDeployment Windows PowerShell 模組來執行唯讀網域控制站電腦帳戶:

Add-addsreadonlydomaincontrolleraccount

如需必要引數和選擇性引數的詳細資訊,請參閱 Stage RODC Windows PowerShell

因為 Add-addsreadonlydomaincontrolleraccount 只有一個包含兩個階段 (先決條件檢查與安裝) 的動作,下列螢幕擷取畫面顯示含有基本必要引數的安裝階段。

Screenshot of the PowerShell window showing the full Add-addsreadonlydomaincontrolleraccount cmdlet.

Screenshot of the PowerShell window showing the result of the Add-addsreadonlydomaincontrolleraccount cmdlet.

RODC 作業階段會在 Active Directory 中建立 RODC 電腦帳戶。 Active Directory 管理中心顯示 [網域控制站類型] 為 [未使用的網域控制站帳戶] 。 此網域控制站類型表示執行的 RODC 帳戶已準備好連結伺服器以做為唯讀的網域控制站。

Screenshot of the Active Directory Administrative Center showing Unoccupied Domain Controller Account highlighted.

重要

要將伺服器連結至唯讀的網域控制站電腦帳戶,已不再需要 Active Directory 管理中心。 使用伺服器管理員和 Active Directory 網域服務設定精靈或 ADDSDeployment Windows PowerShell 模組 Cmdlet Install-AddsDomainController ,即可將新的 RODC 連結至其執行的帳戶。 除了執行的 RODC 電腦帳戶包含您執行 RODC 電腦帳戶時決定的設定選項以外,步驟類似於將新的可寫入網域控制站加入現有的網域。

正在附加

部署組態

Screenshot of the Deployment Configuration page of the Active Directory Domain Services Configuration Wizard.

[伺服器管理員] 會從 [部署設定] 頁面開始升級每個網域控制站。 這個頁面及後續頁面的剩餘選項及必要欄位會隨著您選取的部署操作而變更。

如果要將唯讀網域控制站新增至現有網域中,請選取 [新增現有網域的網域控制站], 然後依序按一下 [選取] 選取按鈕、[提供此網域的網域資訊]。 伺服器管理員會自動提示您輸入有效的認證,或者您可以選取 [變更]

連結 RODC 需要 Windows Server 2012 中 Domain Admins 群組的成員資格。 如果您目前的認證不具有適當的權限或群組成員資格,稍後 [Active Directory 網域服務設定精靈] 會提示您。

部署設定 ADDSDeployment Windows PowerShell Cmdlet 與引數為:

Install-AddsDomainController
-domainname <string>
-credential <pscredential>

網域控制站選項

Screenshot of the Domain Controller Options page of the Active Directory Domain Services Configuration Wizard.

[網域控制站選項] 頁面顯示新網域控制站的網域控制站選項。 當這個頁面載入時,Active Directory 網域服務設定精靈會將 LDAP 查詢傳送到現有的網域控制站,以檢查是否有未使用的帳戶。 如果查詢找到某個使用的網域控制站電腦帳戶與目前的電腦共用相同的名稱,則精靈會在頁面頂端顯示一則資訊訊息:某個預先建立的 RODC 帳戶和目錄中存在的目標伺服器名稱相符。請選擇要使用現有的 RODC 帳戶或重新安裝此網域控制站。 精靈會使用 [使用現有的 RODC 帳戶] 作為預設設定。

重要

當網域控制站發生實體問題而無法回復功能時,您可以使用 [重新安裝此網域控制站] 。 這可節省設定取代網域控制站的時間,因為能在 Active Directory 中保留網域控制站電腦帳戶與物件中繼資料。 使用 相同的名稱安裝新的電腦,並將它升級為網域中的網域控制站。 如果您從 Active Directory 中移除網域控制站物件的中繼資料 (中繼資料清除),[重新安裝此網域控制站] 選項會無法使用。

當您將伺服器連結至 RODC 電腦帳戶時,無法設定網域控制站選項。 您要在建立執行的 RODC 電腦帳戶時設定網域控制站選項。

指定的 [目錄服務還原模式密碼] 必須遵守套用至伺服器的密碼原則。 務必選擇複雜的強式密碼,或者最好是使用複雜密碼。

網域控制站選項 ADDSDeployment Windows PowerShell 引數為:

-UseExistingAccount <{$true | $false}>
-SafeModeAdministratorPassword <secure string>

重要

提供站台名稱做為 -sitename 引數的時候,它必須已經存在。 install-AddsDomainController Cmdlet 不會建立站台名稱。 您可以使用 Cmdlet new-adreplicationsite 來建立新的站台。

如未指定, Install-ADDSDomainController 引數會使用與伺服器管理員相同的預設值。

SafeModeAdministratorPassword 引數的操作方式比較特殊:

  • 如果沒有指定為引數,Cmdlet 會提示您輸入並確認不顯示字元的密碼。 這是以互動方式執行 Cmdlet 時的慣用用法。

    例如,在 corp.contoso.com 中建立新的 RODC,並提示輸入和確認不顯示字元的密碼:

    Install-ADDSDomainController -DomainName corp.contoso.com -credential (get-credential)
    
  • 如果使用值指定,則這個值必須是安全字串。 以互動方式執行 Cmdlet 時,這不是慣用的使用方式。

例如,您可以使用 Read-Host Cmdlet 手動提示輸入密碼,提示使用者輸入安全字串:

-safemodeadministratorpassword (read-host -prompt Password: -assecurestring)

警告

因為前一個選項不會確認密碼,所以請務必小心使用:密碼是看不到的。

您也可以提供轉換的純文字變數當做安全字串,不過我們不鼓勵這種做法。

-safemodeadministratorpassword (convertto-securestring Password1 -asplaintext -force)

最後,您可以將模糊化密碼儲存到檔案中以在稍後重複使用,而不顯示純文字密碼。 例如:

$file = c:\pw.txt
$pw = read-host -prompt Password: -assecurestring
$pw | ConvertFrom-SecureString | Set-Content $file

-safemodeadministratorpassword (Get-Content $File | ConvertTo-SecureString)

警告

不建議提供或儲存純文字或模糊化的密碼。 在指令碼中執行這個命令或監視您的任何人都會知道這個網域的 DSRM 密碼。 任何能夠存取該檔案的人都可以回復模糊化的密碼。 一旦具備該知識,他們可以登入以 DSRM 啟動的網域控制站,最終模擬網域控制站本身,並將他們在 AD 樹系中的權限提升至最高。 有一組建議的額外步驟使用 System.Security.Cryptography 將文字檔資料加密,不過這不在本文的討論範圍內。 最佳做法是完全避免儲存密碼。

其他選項

Screenshot of the Additional Options page of the Active Directory Domain Services Configuration Wizard.

[其他選項] 頁面提供可將網域控制站指定為複寫來源的設定選項,或者您可以使用任一網域控制站做為複寫來源。

您也可以使用「從媒體安裝」(IFM) 選項,使用備份的媒體來安裝網域控制站。 選取 [從媒體安裝] 核取方塊時會提供瀏覽選項,您必須選取 [驗證] 以確保提供的路徑是有效的媒體。

IFM 來源的指導方針:

  • IFM 選項所使用的媒體是使用 Windows Server Backup 或 Ntdsutil.exe,從另一個只有相同作業系統版本的現有 Windows Server 網域控制站建立。 例如,您無法使用 Windows Server 2008 R2 或先前版本的作業系統來建立 Windows Server 2012 網域控制站的媒體。
  • IFM 來源資料應該來自可寫入的網域控制站。 雖然 RODC 的來源在技術上可用於建立新的 RODC,但存在誤判複寫警告,表示 IFM 來源 RODC 無法複寫。

如需 IFM 中變更的詳細資訊,請參閱 Ntdsutil.exe Install from Media Changes。 如果使用以 SYSKEY 保護的媒體,伺服器管理員在驗證期間會提示輸入映像的密碼。

Screenshot of the Command Prompt window showing the results of running ntdsutil.

[其他選項] ADDSDeployment Cmdlet 引數是:

-replicationsourcedc <string>
-installationmediapath <string>
-systemkey <secure string>

路徑

Screenshot of the Paths page of the Active Directory Domain Services Configuration Wizard.

[路徑] 頁面能讓您覆寫 AD DS 資料庫、資料庫交易記錄以及 SYSVOL 共用的預設資料夾位置。 預設位置一律是在 %systemroot% 的子目錄中。 [路徑] ADDSDeployment Cmdlet 引數是:

-databasepath <string>
-logpath <string>
-sysvolpath <string>

檢閱選項和檢視指令碼

Screenshot of the Review Options page of the Active Directory Domain Services Configuration Wizard.

[檢閱選項] 頁面能讓您驗證設定,並確保它們符合您的需求,然後才開始安裝。 這不是使用 [伺服器管理員] 停止安裝的最後機會。 這個頁面只是讓您檢閱並確認設定,然後才繼續設定。 [伺服器管理員] 中的 [檢閱選項] 頁面也提供選用的 [檢視指令碼] 按鈕,用來建立一個包含目前的 ADDSDeployment 設定的 Unicode 文字檔,以便做為一個 Windows PowerShell 指令碼。 這樣可以讓您將 [伺服器管理員] 的圖形介面當作 Windows PowerShell 部署工作室一樣操作。 使用 [Active Directory 網域服務設定精靈] 來設定選項、匯出設定,然後取消精靈。 這個程序會建立一個有效且合乎語義的正確範例,以備日後修改或直接使用。 例如:

#
# Windows PowerShell Script for AD DS Deployment
#

Import-Module ADDSDeployment
Install-ADDSDomainController `
-Credential (Get-Credential) `
-CriticalReplicationOnly:$false `
-DatabasePath C:\Windows\NTDS `
-DomainName corp.contoso.com `
-LogPath C:\Windows\NTDS `
-SYSVOLPath C:\Windows\SYSVOL `
-UseExistingAccount:$true `
-Norebootoncompletion:$false
-Force:$true

注意

[伺服器管理員] 通常會在升級時填入所有引數的值,並不會依賴預設值 (因為它們在未來的 Windows 版本或 Service Pack 中可能會變更)。 -safemodeadministratorpassword 引數是個例外。 以互動方式執行 Cmdlet 時強制確認提示省略值

使用選擇性的 Whatif 引數搭配 Install-ADDSDomainController Cmdlet 來檢閱設定資訊。 這可讓您看到 Cmdlet 引數的明確值和隱含值。

Screenshot of the PowerShell window showing the results of the Install-ADDSDomainController cmdlet.

必要條件檢查

Screenshot of the Prerequisites Check page of the Active Directory Domain Services Configuration Wizard.

[先決條件檢查] 是 AD DS 網域設定中的新功能。 這個新階段會驗證伺服器設定是否能夠支援新的 AD DS 樹系。

安裝新的樹系根網域時,[伺服器管理員] 的 [Active Directory 網域服務設定精靈] 會叫用一系列序列化的模組化測試。 這些測試會提醒您建議的修復選項。 您可以視需要執行多次測試。 必須通過所有的必要條件測試,網域控制站安裝程序才能繼續。

[先決條件檢查] 也會提供諸如影響舊版作業系統之安全性變更的相關資訊。 如需先決條件檢查的詳細資訊,請參閱 Prerequisite Checking

使用 [伺服器管理員] 時無法略過 [必要條件檢查],但您可以在使用 AD DS 部署 Cmdlet 時使用下列引數略過該程序:

-skipprechecks

警告

Microsoft 建議您不要略過先決條件檢查,因為這樣可能會導致網域控制站升級不完整或 AD DS 樹系損毀。

選取 [安裝] 以開始網域控制站升級程序。 這是取消安裝的最後機會。 升級程序一旦開始就無法取消。 不論升級結果如何,升級結束時電腦都會自動重新開機。

安裝

Screenshot of the Installation page of the Active Directory Domain Services Configuration Wizard.

當 [安裝] 頁面顯示時,網域控制站設定程序就開始執行,而且無法暫停或取消。 詳細的作業會顯示此頁面上,而且會寫入到記錄檔:

  • %systemroot%\debug\dcpromo.log

  • %systemroot%\debug\dcpromoui.log

如果要使用 DDSDeployment 模組安裝新的 Active Directory 樹系,請使用下列 Cmdlet:

Install-addsdomaincontroller

如需必要引數和選擇性引數的詳細資訊,請參閱 Attach RODC Windows PowerShell

Install-addsdomaincontroller Cmdlet 只有兩個階段 (先決條件檢查與安裝)。 下列兩個圖形顯示使用 -domainname-useexistingaccount-credential的基本必要引數的安裝階段。 請注意 Install-ADDSDomainController 如何提醒您升級會自動將伺服器重新開機 (和伺服器管理員一樣):

Screenshot of the PowerShell window showing the result of the Install-addsdomaincontroller cmdlet.

Screenshot of the PowerShell window showing the progress of the validation and installation.

若要自動接受重新開機的提示,請使用 -force-confirm:$false 引數搭配任一 ADDSDeployment Windows PowerShell Cmdlet。 若要避免伺服器在升級結束時自動重新開機,請使用 -norebootoncompletion 引數。

警告

建議您不要覆寫重新開機設定。 網域控制站必須重新開機才能正常運作。

結果

Screenshot of the Results page of the Active Directory Domain Services Configuration Wizard.

[結果] 頁面會顯示升級成功或失敗,以及任何重要的系統管理資訊。 網域控制站會在 10 秒後自動重新開機。

沒有執行工作流程的 RODC

下圖說明已安裝過 AD DS 角色,並且使用伺服器管理員啟動 Active Directory 網域服務設定精靈以在現有的 Windows Server 2012 網域中建立新的未暫存網域控制站時的 Active Directory 網域服務設定程序。

Diagram showing the Active Directory Domain Services Read-Only Domain Controller process, as described above, without the staging workflow.

沒有執行 Windows PowerShell 的 RODC

ADDSDeployment Cmdlet 引數 (粗體 的引數是必要的。斜體 的引數可以使用 Windows PowerShell 或 [AD DS 設定精靈] 來指定。)
Install-AddsDomainController -SkipPreChecks

-DomainName

-SafeModeAdministratorPassword

-SiteName

-ApplicationPartitionsToReplicate

-CreateDNSDelegation

-Credential

-CriticalReplicationOnly

-DatabasePath

-DNSDelegationCredential

-DNSOnNetwork

-InstallationMediaPath

-InstallDNS

-LogPath

-MoveInfrastructureOperationMasterRoleIfNecessary

-NoGlobalCatalog

-Norebootoncompletion

-ReplicationSourceDC

-SkipAutoConfigureDNS

-SystemKey

-SYSVOLPath

-AllowPasswordReplicationAccountName

-DelegatedAdministratorAccountName

-DenyPasswordReplicationAccountName

-ReadOnlyReplica

注意

當您不是以 Domain Admins 群組成員的身分登入時,才需要 -credential 引數。

沒有執行部署的 RODC

部署組態

Screenshot of the Deployment Configuration page of the Active Directory Domain Services Configuration Wizard when there is no staging deployment.

[伺服器管理員] 會從 [部署設定] 頁面開始升級每個網域控制站。 這個頁面及後續頁面的剩餘選項及必要欄位會隨著您選取的部署操作而變更。

如果要將未暫存的唯讀網域控制站新增至現有的 Windows Server 2012 網域中,請選取 [新增現有網域的網域控制站], 然後依序選取 [選取] 按鈕、[提供此網域的網域資訊] 。 伺服器管理員會自動提示您輸入有效的認證,或者您可以選取 [變更]

連結 RODC 需要 Windows Server 2012 中 Domain Admins 群組的成員資格。 如果您目前的認證不具有適當的權限或群組成員資格,稍後 [Active Directory 網域服務設定精靈] 會提示您。

部署設定 ADDSDeployment Windows PowerShell Cmdlet 與引數為:

Install-AddsDomainController
-domainname <string>
-credential <pscredential>

網域控制站選項

Screenshot of the Domain Controller Options page of the Active Directory Domain Services Configuration Wizard when there is no staging deployment.

[網域控制站選項] 頁面指定新網域控制站的網域控制站功能。 可設定的網域控制站功能包括 [DNS 伺服器] 和 [通用類別目錄],以及 [唯讀網域控制站]。 Microsoft 建議所有網域控制站都提供 DNS 與 GC 服務,以在分散式環境中獲得高可用性。 GC 一律是預設選項,而如果目前的網域已在以起始授權 (SOA) 查詢為基礎的網域控制站上代管 DNS,則預設會選取 DNS 伺服器。

[網域控制站選項] 頁面也能讓您從樹系設定選擇適當的 Active Directory 邏輯 [站台名稱]。 它預設會選取包含最正確子網路的站台。 如果只有一個站台,就會自動選取該站台。

重要

如果伺服器不屬於某個 Active Directory 子網路且有一個以上的 Active Directory 站台,則不會選取任何站台,而且會等到您從清單選擇一個站台後,[下一步] 按鈕才可以使用。

指定的 [目錄服務還原模式密碼] 必須遵守套用至伺服器的密碼原則。 請一律選擇強式的複雜密碼或最好是複雜密碼。網域控制站選項 ADDSDeployment Windows PowerShell 引數為:

-UseExistingAccount <{$true | $false}>
-SafeModeAdministratorPassword <secure string>

重要

提供站台名稱做為 -sitename 引數的時候,它必須已經存在。 install-AddsDomainController Cmdlet 不會建立站台名稱。 您可以使用 Cmdlet new-adreplicationsite 來建立新的站台。

如未指定, Install-ADDSDomainController 引數會使用與伺服器管理員相同的預設值。

SafeModeAdministratorPassword 引數的操作方式比較特殊:

  • 如果沒有指定為引數,Cmdlet 會提示您輸入並確認不顯示字元的密碼。 這是以互動方式執行 Cmdlet 時的慣用用法。

    例如,在 corp.contoso.com 中建立新的 RODC,並提示輸入和確認不顯示字元的密碼:

    Install-ADDSDomainController -DomainName corp.contoso.com -credential (get-credential)
    
  • 如果使用值指定,則這個值必須是安全字串。 以互動方式執行 Cmdlet 時,這不是慣用的使用方式。

例如,您可以使用 Read-Host Cmdlet 手動提示輸入密碼,提示使用者輸入安全字串:

-safemodeadministratorpassword (read-host -prompt Password: -assecurestring)

警告

因為前一個選項不會確認密碼,所以請務必小心使用:密碼是看不到的。

您也可以提供轉換的純文字變數當做安全字串,不過我們不鼓勵這種做法。

-safemodeadministratorpassword (convertto-securestring Password1 -asplaintext -force)

最後,您可以將模糊化密碼儲存到檔案中以在稍後重複使用,而不顯示純文字密碼。 例如:

$file = c:\pw.txt
$pw = read-host -prompt Password: -assecurestring
$pw | ConvertFrom-SecureString | Set-Content $file

-safemodeadministratorpassword (Get-Content $File | ConvertTo-SecureString)

警告

不建議提供或儲存純文字或模糊化的密碼。 在指令碼中執行這個命令或監視您的任何人都會知道這個網域的 DSRM 密碼。 任何能夠存取該檔案的人都可以回復模糊化的密碼。 一旦具備該知識,他們可以登入以 DSRM 啟動的網域控制站,最終模擬網域控制站本身,並將他們在 AD 樹系中的權限提升至最高。 有一組建議的額外步驟使用 System.Security.Cryptography 將文字檔資料加密,不過這不在本文的討論範圍內。 最佳做法是完全避免儲存密碼。

RODC 選項

Screenshot of the RODC Options page of the Active Directory Domain Services Configuration Wizard when there is no staging deployment.

[RODC 選項] 頁面可讓您修改下列設定:

  • 委派的系統管理員帳戶

  • 可複寫密碼至 RODC 的帳戶

  • 不可複寫密碼至 RODC 的帳戶

委派的系統管理員帳戶可取得對 RODC 的本機管理權限。 這些使用者可以使用與本機電腦 Administrators 群組對等的權限進行操作。 他們不是 Domain Admins 群組的成員或網域內建的 Administrators 群組的成員。 這個選項對於委派分公司管理權卻不用釋出網域管理權限很有用。 不需要設定管理委派。

對等的 ADDSDeployment Windows PowerShell 引數為:

-delegatedadministratoraccountname <string>

不允許在 RODC 上快取密碼且無法連線可寫入網域控制站並驗證其身分的帳戶,無法存取 Active Directory 所提供的資源或功能。

重要

如未修改,會使用預設的群組和設定:

  • Administrators - 拒絕
  • Server Operators - 拒絕
  • Backup Operators - 拒絕
  • Account Operators - 拒絕
  • 拒絕的 RODC 密碼複寫群組 - 拒絕
  • 允許的 RODC 密碼複寫群組 - 允許

對等的 ADDSDeployment Windows PowerShell 引數為:

-allowpasswordreplicationaccountname <string []>
-denypasswordreplicationaccountname <string []>

Screenshot of the Select User, Computer, Service Account dialog box.

其他選項

Screenshot of the Additional Options page of the Active Directory Domain Services Configuration Wizard when there is no staging deployment.

[其他選項] 頁面提供可將網域控制站指定為複寫來源的設定選項,或者您可以使用任一網域控制站做為複寫來源。

您也可以使用「從媒體安裝」(IFM) 選項,使用備份的媒體來安裝網域控制站。 選取 [從媒體安裝] 核取方塊時會提供瀏覽選項,您必須選取 [驗證] 以確保提供的路徑是有效的媒體。

IFM 來源的指導方針:

  • IFM 選項所使用的媒體是使用 Windows Server Backup 或 Ntdsutil.exe,從另一個只有相同作業系統版本的現有 Windows Server 網域控制站建立。 例如,您無法使用 Windows Server 2008 R2 或先前版本的作業系統來建立 Windows Server 2012 網域控制站的媒體。
  • IFM 來源資料應該來自可寫入的網域控制站。 雖然 RODC 的來源在技術上可用於建立新的 RODC,但存在誤判複寫警告,表示 IFM 來源 RODC 無法複寫。

如需 IFM 中變更的詳細資訊,請參閱 Ntdsutil.exe Install from Media Changes。 如果使用以 SYSKEY 保護的媒體,伺服器管理員在驗證期間會提示輸入映像的密碼。

Screenshot of the Command Prompt window showing the results of running ntdsutil when there is no staging deployment.

[其他選項] ADDSDeployment Cmdlet 引數是:

-replicationsourcedc <string>
-installationmediapath <string>
-systemkey <secure string>

路徑

Screenshot of the Paths page of the Active Directory Domain Services Configuration Wizard when there is no staging deployment.

[路徑] 頁面能讓您覆寫 AD DS 資料庫、資料庫交易記錄以及 SYSVOL 共用的預設資料夾位置。 預設位置一律是在 %systemroot% 的子目錄中。 [路徑] ADDSDeployment Cmdlet 引數是:

-databasepath <string>
-logpath <string>
-sysvolpath <string>

準備選項

Screenshot of the Preparation Options page of the Active Directory Domain Services Configuration Wizard when there is no staging deployment.

[準備選項] 頁面會警示您 AD DS 設定包括延伸結構描述 (forestprep) 及更新網域 (domainprep)。 只有在舊版的 Windows Server 2012 網域控制站安裝尚未準備樹系或網域時,或是您手動執行 Adprep.exe 時,才會看到這個頁面。 例如,如果您將新的複本網域控制站新增至現有的 Windows Server 2012 樹系根網域,Active Directory 網域服務設定精靈會封鎖這個頁面。

當您選取 [下一步] 時,並不會延伸結構描述和更新網域。 這些事件只會在安裝階段發生。 這個頁面只是提示稍後安裝時將發生的事件。

這個頁面也會驗證目前使用者的認證是否為 Schema Admin 及 Enterprise Admins 群組的成員,因為您需要這些群組的成員資格才能延伸結構描述或準備網域。 如果這個頁面通知您目前的認證未提供足夠的權限,請選取 [變更] 以提供適當的使用者認證。

[其他選項] ADDSDeployment Cmdlet 引數為:

-adprepcredential <pscredential>

重要

與舊版 Windows Server 一樣,Windows Server 2012 的自動化網域準備不會執行 GPPREP。 請為之前不是為 Windows Server 2003、Windows Server 2008 或 Windows Server 2008 R2 準備的所有網域手動執行 adprep.exe /gpprep。 您應只在網域的歷程記錄中執行一次 GPPrep,而不是每次升級時都執行。 Adprep.exe 不會自動執行 /gpprep,因其結果可能導致重新複寫所有網域控制站上 SYSVOL 資料夾中的所有檔案和資料夾。

當您升級網域中的第一個未執行的 RODC 時,即會執行自動 RODCPrep。 它並不是在您升級第一個可寫入的 Windows Server 2012 網域控制站時發生。 如果您計劃部署唯讀網域控制站,您也仍然可以手動執行 adprep.exe /rodcprep

檢閱選項和檢視指令碼

Screenshot of the Review Options page of the Active Directory Domain Services Configuration Wizard when there is no staging deployment.

[檢閱選項] 頁面能讓您驗證設定,並確保它們符合您的需求,然後才開始安裝。 這不是使用 [伺服器管理員] 停止安裝的最後機會。 這個頁面只是讓您檢閱並確認設定,然後才繼續設定。

[伺服器管理員] 中的 [檢閱選項] 頁面也提供選用的 [檢視指令碼] 按鈕,用來建立一個包含目前的 ADDSDeployment 設定的 Unicode 文字檔,以便做為一個 Windows PowerShell 指令碼。 這樣可以讓您將 [伺服器管理員] 的圖形介面當作 Windows PowerShell 部署工作室一樣操作。 使用 [Active Directory 網域服務設定精靈] 來設定選項、匯出設定,然後取消精靈。 這個程序會建立一個有效且合乎語義的正確範例,以備日後修改或直接使用。 例如:

#
# Windows PowerShell Script for AD DS Deployment
#

Import-Module ADDSDeployment
Install-ADDSDomainController `
-AllowPasswordReplicationAccountName @(CORP\Allowed RODC Password Replication Group, CORP\Chicago RODC Admins, CORP\Chicago RODC Users and Computers) `
-Credential (Get-Credential) `
-CriticalReplicationOnly:$false `
-DatabasePath C:\Windows\NTDS `
-DelegatedAdministratorAccountName CORP\Chicago RODC Admins `
-DenyPasswordReplicationAccountName @(BUILTIN\Administrators, BUILTIN\Server Operators, BUILTIN\Backup Operators, BUILTIN\Account Operators, CORP\Denied RODC Password Replication Group) `
-DomainName corp.contoso.com `
-InstallDNS:$true `
-LogPath C:\Windows\NTDS `
-ReadOnlyReplica:$true `
-SiteName Default-First-Site-Name `
-SYSVOLPath C:\Windows\SYSVOL
-Force:$true

注意

[伺服器管理員] 通常會在升級時填入所有引數的值,並不會依賴預設值 (因為它們在未來的 Windows 版本或 Service Pack 中可能會變更)。 -safemodeadministratorpassword 引數是個例外。 若要強制確認提示,以互動方式執行 Cmdlet 時請省略該值。

使用選擇性的 Whatif 引數搭配 Install-ADDSDomainController Cmdlet 來檢閱設定資訊。 這可讓您看到 Cmdlet 引數的明確值和隱含值。

Screenshot of the PowerShell window showing the results of the Install-ADDSDomainController cmdlet when there is no staging deployment.

必要條件檢查

Screenshot of the Prerequisites Check page of the Active Directory Domain Services Configuration Wizard when there is no staging deployment.

[先決條件檢查] 是 AD DS 網域設定中的新功能。 這個新階段會驗證伺服器設定是否能夠支援新的 AD DS 樹系。

安裝新的樹系根網域時,[伺服器管理員] 的 [Active Directory 網域服務設定精靈] 會叫用一系列序列化的模組化測試。 這些測試會提醒您建議的修復選項。 您可以視需要執行多次測試。 必須通過所有先決條件測試,網域控制站程序才能繼續。

[先決條件檢查] 也會提供諸如影響舊版作業系統之安全性變更的相關資訊。

使用 [伺服器管理員] 時無法略過 [必要條件檢查],但您可以在使用 AD DS 部署 Cmdlet 時使用下列引數略過該程序:

-skipprechecks

選取 [安裝] 以開始網域控制站升級程序。 這是取消安裝的最後機會。 升級程序一旦開始就無法取消。 不論升級結果如何,升級結束時電腦都會自動重新開機。

安裝

Screenshot of the Installation page of the Active Directory Domain Services Configuration Wizard when there is no staging deployment.

當 [安裝] 頁面顯示時,網域控制站設定程序就開始執行,而且無法暫停或取消。 詳細的作業會顯示此頁面上,而且會寫入到記錄檔:

  • %systemroot%\debug\dcpromo.log

  • %systemroot%\debug\dcpromoui.log

如果要使用 DDSDeployment 模組安裝新的 Active Directory 樹系,請使用下列 Cmdlet:

Install-addsdomaincontroller

如需必要引數和選擇性引數,請參閱本節開頭的 [ADDSDeployment Cmdlet] 表格。

Install-addsdomaincontroller Cmdlet 只有兩個階段 (先決條件檢查與安裝)。 下列兩個圖形顯示使用 -domainname-readonlyreplica-sitename-credential的基本必要引數的安裝階段。 請注意 Install-ADDSDomainController 如何提醒您升級會自動將伺服器重新開機 (和伺服器管理員一樣):

Screenshot of the PowerShell window showing the result of the Install-addsdomaincontroller cmdlet when there is no staging deployment.

Screenshot of the PowerShell window showing the progress of the validation and installation when there is no staging deployment.

若要自動接受重新開機的提示,請使用 -force-confirm:$false 引數搭配任一 ADDSDeployment Windows PowerShell Cmdlet。 若要避免伺服器在升級結束時自動重新開機,請使用 -norebootoncompletion 引數。

警告

建議您不要覆寫重新開機設定。 網域控制站必須重新開機才能正常運作。 如果您登出網域控制站,必須在重新啟動後您才能以互動方式重新登入。

結果

Screenshot of the Results page of the Active Directory Domain Services Configuration Wizard when there is no staging deployment.

[結果] 頁面會顯示升級成功或失敗,以及任何重要的系統管理資訊。 網域控制站會在 10 秒後自動重新開機。