我们使用System Center 2012虚拟机pipe理器将虚拟机部署到我们的Hyper-V服务器。 我们开始使用虚拟机和服务模板来自动化我们的系统部署,但是我们需要自动化的一步就是将服务器添加到特定组织单元下的Active Directory域中。 我可以创build一个使用运行方式帐户的客户机操作系统configuration文件将服务器连接到域,但是没有指定OU的选项:

如何指定要在join域时使用的OU?
使用Guest OSconfiguration文件将虚拟机join域时,有两种方法可以指定OU。 首先是使用Get-SCGuestOSProfile和Set-SCGuestOSProfile PowerShell cmdlet来修改用于join域的DomainJoinOrganizationalUnit设置 。 这是最直接的方法,但在GUI中不可见,并且设置起来更难。
第二种方法是将unattend.xml文件添加到包含MachineObjectOU元素的VMM库中。 就我而言,我使用以下方式将2012服务器join到我们的Child.Parent.com域的“我的服务器”OU中:
<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="specialize"> <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> <Identification> <MachineObjectOU>OU=My Servers,DC=Child,DC=Parent,DC=com</MachineObjectOU> </Identification> </component> </settings> </unattend>
unattend.xml文件将与客户操作系统configuration文件中提供的设置(如域join凭证)合并,因此该选项还可以让您自定义其他安装设置,并且仍然可以在GUI中看到。