我正在尝试部署多个 Win 7 实例(32 位和 64 位混合),全部使用 Win 7 Enterprise。我正在使用 Windows AIK 生成无人值守文件。
我遵循了指南这里大部分情况下。阅读其他地方在网上,我开始相信,如果我将值设置<ComputerName>
为*
,Windows 会在出现时生成一个随机的计算机名称。我也尝试将其设置为空字符串:<ComputerName></ComputerName>
但结果还是一样,系统会提示。
到目前为止,我似乎无法让它尊重我的无人值守文件中的该字段。无论我输入*
还是其他字符串,test_name
它总是会出现并提示我输入计算机名称,并且始终默认为PC
。
这是我的 unattend.xml 文件:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="generalize">
<component name="Microsoft-Windows-Security-SPP" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipRearm>8</SkipRearm>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Deployment" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>net user administrator /active:yes</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>
<component name="Microsoft-Windows-Security-SPP-UX" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>*</ComputerName>
<CopyProfile>true</CopyProfile>
<TimeZone>Eastern Standard Time</TimeZone>
<ShowWindowsLive>false</ShowWindowsLive>
<ProductKey>REDACTED</ProductKey>
</component>
<component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Identification>
<UnsecureJoin>true</UnsecureJoin>
<JoinDomain>corp.local</JoinDomain>
</Identification>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<InputLocale>en-us</InputLocale>
<SystemLocale>en-us</SystemLocale>
<UILanguage>en-us</UILanguage>
<UserLocale>en-us</UserLocale>
</component>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UserAccounts>
<LocalAccounts>
<LocalAccount wcm:action="add">
<Password>
<Value>REDACTED</Value>
<PlainText>false</PlainText>
</Password>
<Description>Local Admin</Description>
<DisplayName>Local Admin</DisplayName>
<Group>Administrators</Group>
<Name>ladmin</Name>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Other</NetworkLocation>
<ProtectYourPC>1</ProtectYourPC>
</OOBE>
<RegisteredOrganization>GTRI</RegisteredOrganization>
<RegisteredOwner>ACTR</RegisteredOwner>
<TimeZone>Eastern Standard Time</TimeZone>
<ShowWindowsLive>false</ShowWindowsLive>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog:d:/sources/install_windows 7 enterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
我还尝试了一个精简的无人值守文件,希望它只设置计算机名称,但它也没有:
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName>*</ComputerName>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog:d:/sources/install_windows 7 enterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>
那么我错过了什么?(此外,加入域的步骤似乎还没有起作用,所以我可能也遇到了错误,但我还没有尝试解决这个症状。)
要使用上述文件我正在运行:
sysprep /oobe /shutdown /unattend:unattend.xml
答案1
还在专门阶段的 Windows-shell-setup 部分中指定 RegisteredOwner 和 RegisteredOrganization。
此外,请注意,如果不在 sysprep 中指定 /generalize 开关,则无法将同一映像部署到多台计算机。这会重置 SID。
最后,请注意您展示的是 32 位无人值守文件。64 位操作系统需要不同的文件。