本主題簡單說明新的 Windows Server 2012 Active Directory 網域服務網域控制站升級功能。 在 Windows Server 2012 中,AD DS 以伺服器管理員和以 Windows PowerShell 為基礎的部署系統取代了 Dcpromo 工具。
Active Directory 網域服務簡化的系統管理
Windows Server 2012 引進新一代的 Active Directory 網域服務簡化的系統管理,而且是自 Windows 2000 Server 以來最基本的網域重新構想。 AD DS 簡化的系統管理參考 Active Directory 十二年的經驗,為架構設計人員和系統管理員提供更耐久、更有彈性、更直覺的系統管理經驗。 這意味著以現有技術建立新版本,以及擴充 Windows Server 2008 R2 中所發行元件的功能。
什麼是 AD DS 簡化的系統管理?
AD DS 簡化的系統管理是網域部署的重新構思。 其中的一些功能包括:
AD DS 角色部署現在是新伺服器管理員架構的一部分,並允許遠端安裝。
AD DS 部署和設定引擎現在是 Windows PowerShell,即使是使用圖形化設定也一樣。
升級現在包含先決條件檢查,可驗證樹系和網域對新網域控制站的整備度,以減少升級失敗的機會。
Windows Server 2012 樹系功能等級不會實作新功能,而且只有新的 Kerberos 功能子集需要網域功能等級,因此系統管理員便不需經常使用同質性的網域控制站環境。
用途與優點
這些變更看起來可能更複雜,而非更簡單。 但是在重新設計的 AD DS 部署程序方面,有機會將許多步驟和最佳做法合併為更少、更簡單的動作。 例如,這表示新的複本網域控制站的圖形化設定現在是八個對話方塊,而不是先前的 12 個。 Creating a new Active Directory forest requires a single Windows PowerShell command with only one argument: the name of the domain.
為什麼在 Windows Server 2012 中會如此強調 Windows PowerShell 呢? 隨著分散式運算的發展,Windows PowerShell 可以讓單一引擎從圖形化介面和和命令列介面設定和維護。 它可允許以等同 API 授予開發人員的最高級 IT 專家成員資格,對任一元件執行功能齊全的指令碼處理。 隨著雲端運算的普及,Windows PowerShell 也終於能夠從遠端管理伺服器,讓沒有圖形化介面的電腦和有監視器及滑鼠的電腦具有相同的管理功能。
資深的 AD DS 系統管理員應該會發現與其先前的知識有高度相關性。 初學的系統管理員將發現學習難度不高。
Technical Overview
開始之前的需知
本主題假設您已熟悉舊版 Active Directory 網域服務,因此不會提供關於它們的用途與功能的基本詳細資訊。 如需 AD DS 的詳細資訊,請參閱下面連結的 TechNet 入口網站頁面:
Functional Descriptions
AD DS 角色安裝
Active Directory 網域服務安裝使用伺服器管理員與 Windows PowerShell,就像 Windows Server 2012 中的其他所有伺服器角色與功能一樣。 Dcpromo.exe 程式不再提供 GUI 設定選項。
您可以在本機和遠端安裝中使用伺服器管理員中的圖形化精靈或 Windows PowerShell 的 ServerManager 模組。 透過執行多個精靈的執行個體或 Cmdlet 和以不同的伺服器為目標,您可以從單一主控台同時將 AD DS 部署到多個網域控制站。 雖然這些新功能不相容於 Windows Server 2008 R2 或舊版作業系統,您也依然可以使用 Windows Server 2008 R2 中引進的 Dism.exe 應用程式,透過傳統的命令列來安裝本機角色。
AD DS 角色設定
Active Directory 網域服務設定 (先前稱為 DCPROMO) 現在是不同於角色安裝的個別作業。 安裝 AD DS 角色後,系統管理員要使用伺服器管理員中獨立的精靈或使用 ADDSDeployment Windows PowerShell 模組,將伺服器設定為網域控制站。
AD DS 角色設定有十二年的實際經驗做基礎,現在可依據最新的 Microsoft 最佳做法來設定網域控制站。 例如,網域名稱系統和通用類別目錄預設會安裝在每個網域控制站。
伺服器管理員 AD DS 設定精靈將許多個別對話方塊合併成較少的提示,並且不再隱藏 [進階] 模式中的設定。 安裝期間,整個升級程序是在一個擴充的對話方塊中進行。 精靈和 ADDSDeployment Windows PowerShell 模組會顯示值得注意的變更與安全性考量,以及進一步資訊的連結。
Dcpromo.exe 保留在 Windows Server 2012 中只是為了執行命令列的自動安裝,但不會再執行圖形化安裝精靈。 強烈建議您不要繼續使用 Dcpromo.exe 進行自動安裝,而是改用 ADDSDeployment 模組來替代,因為這個現已被取代的可執行檔不會包含在下一版的 Windows 中。
這些新功能不相容於 Windows Server 2008 R2 或舊版作業系統。
Important
Dcpromo.exe 不再包含圖形化精靈,因而不會再安裝角色或功能二進位檔。 嘗試透過 Explorer Shell 執行 Dcpromo.exe 會傳回:
「Active Directory 網域服務安裝精靈已移至伺服器管理員。 如需詳細資訊,請參閱 https://go.microsoft.com/fwlink/?LinkId=220921。」
與在舊版的作業系統中一樣,嘗試執行 Dcpromo.exe /unattend 仍會安裝二進位檔,但會發出警告:
「Windows PowerShell 的 ADDSDeployment 模組已取代 dcpromo 自動作業。 如需詳細資訊,請參閱 https://go.microsoft.com/fwlink/?LinkId=220924。」
dcpromo.exe 在 Windows Server 2012 中是不建議使用的功能 ,因此它將不會包含在未來的 Windows 版本中,在此作業系統中也不會有進一步的增強。 系統管理員應停止繼續使用它,如果他們想透過命令列建立網域控制站,應改用支援的 Windows PowerShell 模組。
Prerequisite Checking
在繼續升級網域控制站之前,網域控制站設定也會實作評估樹系和網域的先決條件檢查階段。 這包括 FSMO 角色可用性、使用者權限、延伸結構描述相容性及其他需求。 這個新設計可減少網域控制站開始升級後因嚴重的設定錯誤而中途停止的問題。 這可減少樹系中有孤立的網域控制站中繼資料或伺服器誤認其為網域控制站的機會。
使用 [伺服器管理員] 部署樹系
本節說明如何使用圖形化的 Windows Server 2012 電腦上的伺服器管理員,在樹系根網域中安裝第一個網域控制站。
伺服器管理員 AD DS 角色安裝程序
下圖說明 Active Directory 網域服務角色安裝程序,從您執行 ServerManager.exe 開始,到網域控制站升級前結束。
伺服器集區與新增角色
任何可從執行伺服器管理員的電腦存取的 Windows Server 2012 電腦都有資格加入集區。 加入集區後,您要在伺服器管理員中選取要遠端安裝 AD DS 的伺服器,或執行任何其他設定選項。
如果要新增伺服器,請選擇下列其中一項:
按一下儀表板歡迎使用磚上的 [新增其他要管理的伺服器]
Click the Manage menu and select Add Servers
Right-click All Servers and choose Add Servers
[新增伺服器] 對話方塊隨即開啟:
其中提供三種方式,供您將伺服器新增至集區以使用或分組:
Active Directory 搜尋 (使用 LDAP,電腦必須屬於網域,允許作業系統篩選且支援萬用字元)
DNS 搜尋 (透過 ARP 或 NetBIOS 廣播或 WINS 查詢,使用 DNS 別名或 IP 位址,不允許作業系統篩選或支援萬用字元)
匯入 (使用以 CR/LF 區隔的伺服器文字檔清單)
Click Find Now to return a list of servers from that same Active Directory domain that the computer is joined to, Click one or more server names from the list of servers. Click the right arrow to add the servers to the Selected list. Use the Add Servers dialog to add selected servers to dashboard role groups. Or Click Manage, and then click Create Server Group, or click Create Server Group on the dashboard Welcome to Server Manager tile to create custom server groups.
Note
新增伺服器程序不會驗證伺服器是上線或可存取狀態。 不過,任何無法連線的伺服器在下次重新整理時將於伺服器管理員的 [管理性] 檢視中加上旗標。
您可以在加入集區的任一部 Windows Server 2012 電腦上遠端安裝角色,如下所示:
您無法完整管理作業系統比 Windows Server 2012 舊的伺服器。 [新增角色及功能] 選取項目執行的是 ServerManager Windows PowerShell 模組 Install-WindowsFeature。
您也可以使用現有的網域控制站上的 [伺服器管理員儀表板] 來選取已預先選取好角色的遠端伺服器 AD DS 安裝,方法是在 AD DS 儀表板磚上按一下滑鼠右鍵,然後選取 [將 AD DS 新增至另一部伺服器] 。 This is invoking Install-WindowsFeature AD-Domain-Services.
執行伺服器管理員的電腦會自行加入集區。 To install the AD DS role here, simply click the Manage menu and click Add Roles and Features.
Installation Type
The Installation Type dialog provides an option that does not support Active Directory Domain Services: the Remote Desktop Services scenario based-installation. 該選項只允許在多伺服器分散式工作負載中的遠端桌面服務。 如果您選取該選項,AD DS 則無法安裝。
安裝 AD DS 時,請始終保留預設的選取項目:[角色型或功能型安裝] 。
Server Selection
The Server Selection dialog enables you to choose from one of the servers previously added to the pool, as long as it is accessible. 執行伺服器管理員的本機伺服器會自動成為可存取狀態。
此外,您可以選取離線 Hyper-V VHD 檔案與 Windows Server 2012 作業系統,伺服器管理員會透過元件服務直接新增角色。 這可讓您在進一步設定虛擬伺服器之前,先使用必要的元件佈建虛擬伺服器。
伺服器角色與功能
如果您想升級網域控制站,請選取 [Active Directory 網域服務] 角色。 所有 Active Directory 管理功能和必要服務都會自動安裝 (即使它們明顯是另一個角色的一部分或在 [伺服器管理員] 介面中不是已選取狀態也一樣)。
Server Manager also presents an informational dialog that shows which management features this role implicitly installs; this is equivalent to the -IncludeManagementTools argument.
Additional Features can be added here as desired.
Active Directory Domain Services
[Active Directory 網域服務] 對話方塊提供有限的需求及最佳做法資訊。 它主要是確認您已選擇 AD DS 角色「如果此畫面未顯示,表示您未選取 AD DS。
Confirmation
The Confirmation dialog is the final checkpoint before role installation starts. 它提供在角色安裝後視需要重新啟動電腦的選項,但 AD DS 安裝不需要重新開機。
By clicking Install, you confirm you are ready to begin role installation. 開始安裝角色後即無法取消。
Results
The Results dialog shows the current installation progress and current installation status. 無論伺服器管理員是否關閉,都會繼續安裝角色。
驗證安裝結果仍是最佳做法。 If you close the Results dialog before installation completes, you can check the results using the Server Manager notification flag. 針對任何已安裝 AD DS 角色但未進一步設定為網域控制站的伺服器,伺服器管理員也會顯示警告訊息。
Task Notifications
AD DS 詳細資料
Task Details
升級成網域控制站
在 AD DS 角色安裝結束時,您可以繼續使用 [將此伺服器升級為網域控制站] 連結來設定。 要使伺服器成為網域控制站,這是必要的動作,但不需要立即執行設定精靈。 例如,您可能只想先使用 AD DS 二進位檔佈建伺服器,再將它們送到另一個分公司進行後續設定。 在運送前新增 AD DS 角色,到了目的地便能節省時間。 您也必須遵守勿使網域控制站離線數天或數週的最佳做法。 最後,這可讓您在升級網域控制站之前更新元件,至少讓您少一次後續重新開機的動作。
Selecting this link later invokes the ADDSDeployment cmdlets: install-addsforest, install-addsdomain, or install-addsdomaincontroller.
Uninstalling/Disabling
無論您是否已將伺服器升級為網域控制站,移除 AD DS 角色的方法和任何其他的角色一樣。 不過,移除 AD DS 角色需要在完成時重新啟動電腦。
Active Directory 網域服務角色移除不同於安裝,它需要先將網域控制站降級才能完成。 這是為了避免網域控制站在未適當清除樹系中的中繼資料的情況下便解除安裝其角色二進位檔。 如需詳細資訊,請參閱降級網域控制站和網域 (層級 200)。
Warning
不支援在升級為網域控制站之後使用 Dism.exe 或 Windows PowerShell DISM 模組移除 AD DS 角色,這樣做將會導致伺服器無法正常開機。
有別於伺服器管理員或 Windows PowerShell 的 AD DS 部署模組,DISM 是原生的服務系統,不會知道固有的 AD DS 或其設定。 除非伺服器不再是網域控制站,否則請勿使用 Dism.exe 或 Windows PowerShell DISM 模組來解除安裝 AD DS 角色。
使用伺服器管理員建立 AD DS 樹系根網域
下圖說明 Active Directory 網域服務設定程序,在案例中,您先前已安裝過 AD DS 角色,並使用伺服器管理員啟動 [Active Directory 網域服務設定精靈] 。
Deployment Configuration
Server Manager begins every domain controller promotion with the Deployment Configuration page. 這個頁面及後續頁面的剩餘選項及必要欄位會隨著您選取的部署操作而變更。
如果要建立新的 Active Directory 樹系,請按一下 [新增樹系] 。 You must provide a valid root domain name; the name cannot be single-labeled (for example, the name must be contoso.com or similar and not just contoso) and must use allowed DNS domain naming requirements.
如需有效網域名稱的詳細資訊,請參閱知識庫文章 Active Directory 中的電腦、網域、網站及 OU 的命名慣例。
Warning
請勿使用與外部 DNS 名稱相同的名稱來建立新的 Active Directory 樹系。 例如,如果您的網際網路 DNS URL 是 https://contoso.com
,就必須為內部樹系選擇不同的名稱,避免之後發生相容性問題。 這個名稱必須是唯一而且不像是會用在網路流量的名稱。 例如:corp.contoso.com。
新樹系的網域系統管理員帳戶不需要新的認證。 網域控制站升級程序會使用用來建立樹系根的第一個網域控制站內建的 Administrator 帳戶的認證。 沒有任何方法 (依預設) 可停用或鎖定內建的 Administrator 帳戶,如果其他系統管理網域帳戶無法使用,它可能是樹系唯一的進入點。 在部署新樹系之前,請務必知道密碼。
DomainName requires a valid fully qualified domain DNS name and is required.
網域控制站選項
[網域控制站選項] 可讓您設定新的樹系根網域的 [樹系功能等級] 和 [網域功能等級] 。 根據預設,這些設定在新的樹系根網域中為 Windows Server 2012。 Windows Server 2012 樹系功能等級未提供高過 Windows Server 2008 R2 樹系功能等級的任何新功能。 之所以需要 Windows Server 2012 網域功能等級,只是為了實作新的 Kerberos 設定「永遠提供宣告」和「失敗的未受保護的驗證要求」。Windows Server 2012 中的功能等級的主要用途,是限制只有符合允許的最低作業系統需求的網域控制站才能加入網域。 換句話說,您可以指定 Windows Server 2012 網域功能等級,僅執行 Windows Server 2012 的網域控制站可以代管網域。 Windows Server 2012 implements a new domain controller flag called DS_WIN8_REQUIRED in the DSGetDcName function of NetLogon that exclusively locates Windows Server 2012 domain controllers. 就何種作業系統可在網域控制站上執行而言,這可讓您彈性擁有更同質或異質的樹系。
如需網域控制站定位的詳細資訊,請檢閱 目錄服務功能。
唯一一個可設定的網域控制站功能為 DNS 伺服器選項。 Microsoft 建議分散式環境中的所有網域控制站都提供 DNS 服務以獲得高可用性,這就是為什麼在任何模式或網域中安裝網域控制站時,預設會選取此選項。 建立新的樹系根網域時,通用類別目錄和唯讀的網域控制站選項都無法使用;第一個網域控制站必須是 GC,不可以是唯讀的網域控制站 (RODC)。
指定的 [目錄服務還原模式密碼] 必須遵守套用至伺服器的密碼原則,預設不需為強式密碼;只需是非空白密碼。 務必選擇複雜的強式密碼,或者最好是使用複雜密碼。
DNS 選項與 DNS 委派認證
The DNS Options page enables you to configure DNS delegation and provide alternate DNS administrative credentials.
You cannot configure DNS options or delegation in the Active Directory Domain Services Configuration Wizard when installing a new Active Directory Forest Root Domain where you selected the DNS server on the Domain Controller Options page. 在現有的 DNS 伺服器基礎結構中建立新的樹系根 DNS 區域時,會提供 [建立 DNS 委派] 選項。 此選項可讓您提供替代的 DNS 系統管理認證,擁有更新 DNS 區域的權限。
如需是否需要建立 DNS 委派的詳細資訊,請參閱了解區域委派。
Additional Options
The Additional Options page shows the NetBIOS name of the domain and enables you to override it. By default, the NetBIOS domain name matches the left-most label of the fully qualified domain name provided on the Deployment Configuration page. 例如,如果您提供的完整的網域名稱是 corp.contoso.com,則預設的 NetBIOS 網域名稱是 CORP。
如果名稱為 15 個字元或更短,且不與其他 NetBIOS 名稱衝突,則名稱不變。 如果名稱與其他 NetBIOS 名稱衝突,系統會在名稱後方附加數字。 如果名稱超過 15 個字元,精靈會提供縮短且具唯一性的建議。 在任一狀況下,精靈都會先透過 WINS 查閱與 NetBIOS 廣播來驗證名稱未使用。
如需有效網域名稱的詳細資訊,請參閱知識庫文章 Active Directory 中的電腦、網域、網站及 OU 的命名慣例。
Paths
The Paths page enables you to override the default folder locations of the AD DS database, the database transaction logs, and the SYSVOL share. 預設位置一律是 %systemroot%(如 C:\Windows) 的子目錄。
檢閱選項和檢視指令碼
The Review Options page enables you to validate your settings and ensure they meet your requirements before you start the installation. 使用 [伺服器管理員] 時,這不是能停止安裝的最後機會。 這只是可讓您在繼續設定前確認設定的選項。
The Review Options page in Server Manager also offers an optional View Script button to create a Unicode text file that contains the current ADDSDeployment configuration as a single Windows PowerShell script. 這樣可以讓您將 [伺服器管理員] 的圖形介面當作 Windows PowerShell 部署工作室一樣操作。 使用 [Active Directory 網域服務設定精靈] 來設定選項、匯出設定,然後取消精靈。 這個程序會建立一個有效且合乎語義的正確範例,以備日後修改或直接使用。 For example:
#
# Windows PowerShell Script for AD DS Deployment
#
Import-Module ADDSDeployment
Install-ADDSForest `
-CreateDNSDelegation `
-DatabasePath "C:\Windows\NTDS" `
-DomainMode "Win2012" `
-DomainName "corp.contoso.com" `
-DomainNetBIOSName "CORP" `
-ForestMode "Win2012" `
-InstallDNS:$true `
-LogPath "C:\Windows\NTDS" `
-NoRebootOnCompletion:$false `
-SYSVOLPath "C:\Windows\SYSVOL"
-Force:$true
Note
[伺服器管理員] 通常會在升級時填入所有引數的值,並不會依賴預設值 (因為它們在未來的 Windows 版本或 Service Pack 中可能會變更)。 The one exception to this is the -safemodeadministratorpassword argument (which is deliberately omitted from the script). 若要強制確認提示,以互動方式執行 Cmdlet 時請省略該值。
Prerequisites Check
The Prerequisites Check is a new feature in AD DS domain configuration. 這個新階段會驗證伺服器設定是否能夠支援新的 AD DS 樹系。
安裝新的樹系根網域時,[伺服器管理員] 的 [Active Directory 網域服務設定精靈] 會叫用一系列的模組化測試。 這些測試會提醒您建議的修復選項。 您可以視需要執行多次測試。 必須通過所有先決條件測試,網域控制站程序才能繼續。
The Prerequisites Check also surfaces relevant information such as security changes that affect older operating systems.
For more information on the specific prerequisite checks, see Prerequisite Checking.
Installation
When the Installation page displays, the domain controller configuration begins and cannot be halted or canceled. 詳細的作業會顯示此頁面上,而且會寫入到記錄檔:
%systemroot%\debug\dcpromo.log
%systemroot%\debug\dcpromoui.log
Note
您可以從相同的伺服器管理員主控台中同時執行多個角色安裝與 AD DS 設定精靈。
Results
The Results page shows the success or failure of the promotion and any important administrative information. 網域控制站會在 10 秒後自動重新開機。
使用 Windows PowerShell 部署樹系
本節說明如何在核心 Windows Server 2012 電腦上使用 Windows PowerShell,在樹系根網域中安裝第一個網域控制站。
Windows PowerShell AD DS 角色安裝程序
透過執行幾個簡單的 ServerManager 部署 Cmdlet 到您的部署程序,您就能進一步了解 AD DS 簡化的系統管理的願景。
The next figure illustrates the Active Directory Domain Services role installation process, beginning with you running PowerShell.exe and ending right before the promotion of the domain controller.
ServerManager Cmdlet | Arguments (Bold arguments are required. Italicized arguments can be specified by using Windows PowerShell or the AD DS Configuration Wizard.) |
---|---|
Install-WindowsFeature/Add-WindowsFeature |
-Name -Restart -IncludeAllSubFeature -IncludeManagementTools -Source -ComputerName -Credential -LogPath -Vhd -ConfigurationFilePath |
Note
While not required, the argument -IncludeManagementTools is highly recommended when installing the AD DS role binaries
ServerManager 模組公開 Windows PowerShell 的新 DISM 模組中角色安裝、狀態及移除的部分。 這個分層簡化了大部分的工作,並降低直接使用強大 (但濫用時有風險) 的 DISM 模組的需求。
Use Get-Command to export the aliases and cmdlets in ServerManager.
Get-Command -module ServerManager
For example:
To add the Active Directory Domain Services role, simply run the Install-WindowsFeature with the AD DS role name as an argument. 和伺服器管理員一樣,AD DS 角色隱含的所有必要服務都會自動安裝。
Install-WindowsFeature -name AD-Domain-Services
If you also want the AD DS management tools installed - and this is highly recommended - then provide the -IncludeManagementTools argument:
Install-WindowsFeature -name AD-Domain-Services -IncludeManagementTools
For example:
To list all features and roles with their installation status, use Get-WindowsFeature without arguments. Specify -ComputerName argument for the installation status from a remote server.
Get-WindowsFeature
Because Get-WindowsFeature does not have a filtering mechanism, you must use Where-Object with a pipeline to find specific features. 管線是用於在多個 Cmdlet 之間傳送資料的通道,而 Where-Object Cmdlet 則做為篩選條件。 The built-in $_ variable acts as the current object passing through the pipeline with any properties it may contain.
Get-WindowsFeature | where-object <options>
For example, to find all features containing "Active Dir" in their Display Name property, use:
Get-WindowsFeature | where displayname -like "*active dir*"
以下是進一步的範例:
如需更多 Windows PowerShell 作業搭配管線與 Where-Object 的詳細資訊,請參閱 Windows PowerShell 中的管線處理與管線。
也請注意,Windows PowerShell 3.0 大幅簡化此管線作業所需的命令列引數。 Windows PowerShell 2.0 會需要:
Get-WindowsFeature | where {$_.displayname - like "*active dir*"}
使用 Windows PowerShell 管線,您可以建立可讀取的結果。 For example:
Install-WindowsFeature | Format-List
Install-WindowsFeature | select-object | Format-List
Note how using the Select-Object cmdlet with the -expandproperty argument returns interesting data:
Note
The Select-Object -expandproperty argument slows down overall installation performance slightly.
使用 Windows PowerShell 建立 AD DS 樹系根網域
如果要使用 DDSDeployment 模組安裝新的 Active Directory 樹系,請使用下列 Cmdlet:
Install-addsforest
The Install-AddsForest cmdlet only has two phases (prerequisite checking and installation). The two figures below show the installation phase with the minimum required argument of -domainname.
ADDSDeployment Cmdlet | Arguments (Bold arguments are required. Italicized arguments can be specified by using Windows PowerShell or the AD DS Configuration Wizard.) |
---|---|
Install-Addsforest | -Confirm -CreateDNSDelegation -DatabasePath -DomainMode -DomainName -DomainNetBIOSName -DNSDelegationCredential -ForestMode -Force -InstallDNS -LogPath -NoDnsOnNetwork -NoRebootOnCompletion -SafeModeAdministratorPassword -SkipAutoConfigureDNS -SkipPreChecks -SYSVOLPath -Whatif |
Note
The -DomainNetBIOSName argument is required if you want to change the automatically generated 15-character name based on the DNS domain name prefix or if the name exceeds 15 characters.
The equivalent Server Manager Deployment Configuration ADDSDeployment cmdlet and arguments are:
Install-ADDSForest
-DomainName <string>
對等的伺服器管理員網域控制站選項 ADDSDeployment Cmdlet 引數為:
-ForestMode <{Win2003 | Win2008 | Win2008R2 | Win2012 | Default}>
-DomainMode <{Win2003 | Win2008 | Win2008R2 | Win2012 | Default}>
-InstallDNS <{$false | $true}>
-SafeModeAdministratorPassword <secure string>
The Install-ADDSForest arguments follow the same defaults as Server Manager if not specified.
The SafeModeAdministratorPassword argument's operation is special:
If not specified as an argument, the cmdlet prompts you to enter and confirm a masked password. 這是以互動方式執行 Cmdlet 時的慣用用法。
例如,建立名稱為 corp.contoso.com 的新樹系,並提示輸入和確認不顯示字元的密碼:
Install-ADDSForest "DomainName corp.contoso.com
如果使用值指定,則這個值必須是安全字串。 這不是以互動方式執行 Cmdlet 時的慣用用法。
For example, you can manually prompt for a password by using the Read-Host cmdlet to prompt the user for a secure string:
-safemodeadministratorpassword (read-host -prompt "Password:" -assecurestring)
Warning
因為前一個選項不會確認密碼,所以請務必小心使用:密碼是看不到的。
您也可以提供轉換的純文字變數當做安全字串,不過我們不鼓勵這種做法。
-safemodeadministratorpassword (convertto-securestring "Password1" -asplaintext -force)
最後,您可以將模糊化密碼儲存到檔案中以在稍後重複使用,而不顯示純文字密碼。 For example:
$file = "c:\pw.txt"
$pw = read-host -prompt "Password:" -assecurestring
$pw | ConvertFrom-SecureString | Set-Content $file
-safemodeadministratorpassword (Get-Content $File | ConvertTo-SecureString)
Warning
不建議提供或儲存純文字或模糊化的密碼。 在指令碼中執行這個命令或監視您的任何人都會知道這個網域的 DSRM 密碼。 任何能夠存取該檔案的人都可以回復模糊化的密碼。 一旦具備該知識,他們可以登入在 DSRM 啟動的網域控制站,最終模擬網域控制站本身,提高其權限到 Active Directory 樹系中的最高層。 An additional set of steps using System.Security.Cryptography to encrypt the text file data is advisable but out of scope. 最佳做法是完全避免儲存密碼。
ADDSDeployment Cmdlet 提供略過自動設定 DNS 用戶端設定、轉寄站及根目錄提示的額外選項。 使用伺服器管理員時,無法略過此設定選項。 如果您是在設定網域控制站之前安裝 DNS 伺服器角色,才需要這個引數:
-SkipAutoConfigureDNS
The DomainNetBIOSName operation is also special:
If the DomainNetBIOSName argument is not specified with a NetBIOS domain name and the single-label prefix domain name in the DomainName argument is 15 characters or fewer, then promotion continues with an automatically generated name.
If the DomainNetBIOSName argument is not specified with a NetBIOS domain name and the single-label prefix domain name in the DomainName argument is 16 characters or more, then promotion fails.
If the DomainNetBIOSName argument is specified with a NetBIOS domain name of 15 characters or fewer, then promotion continues with that specified name.
If the DomainNetBIOSName argument is specified with a NetBIOS domain name of 16 characters or more, then promotion fails.
對等的伺服器管理員其他選項 ADDSDeployment Cmdlet 引數為:
-domainnetbiosname <string>
The equivalent Server Manager Paths ADDSDeployment cmdlet arguments are:
-databasepath <string>
-logpath <string>
-sysvolpath <string>
Use the optional Whatif argument with the Install-ADDSForest cmdlet to review configuration information. 這可讓您看到明確和隱含的 Cmdlet 引數值。
For example:
You cannot bypass the Prerequisite Check when using Server Manager, but you can skip the process when using the AD DS Deployment cmdlet using the following argument:
-skipprechecks
Warning
Microsoft 建議您不要略過先決條件檢查,因為這樣可能會導致網域控制站升級不完整或 AD DS 樹系損毀。
Note how, just like Server Manager, Install-ADDSForest reminds you that promotion will reboot the server automatically.
To accept the reboot prompt automatically, use the -force or -confirm:$false arguments with any ADDSDeployment Windows PowerShell cmdlet. To prevent the server from automatically rebooting at the end of promotion, use the -norebootoncompletion argument.
Warning
建議您不要覆寫重新開機設定。 網域控制站必須重新開機才能正常運作。
See Also
Active Directory Domain Services (TechNet Portal)適用於 Windows Server 2008 R2 的 Active Directory Domain Services適用於 Windows Server 2008 的 Active Directory Domain ServicesWindows Server 技術參考 (Windows Server 2003)Active Directory 管理中心:開始使用 (Windows Server 2008 R2)Active Directory Administration with Windows PowerShell (Windows Server 2008 R2)詢問目錄服務小組 (官方 Microsoft 商業技術支援部落格)