Unattend.xml模板 [英] Unattend.xml Template

查看:147
本文介绍了Unattend.xml模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在设置WSP为客户端配置VPS。我已根据文档创建了模板,但是每当我在创建模板后编辑unattend.xml文件时,它就会在创建VPS时失败。这是我目前在unattend.xml中的内容:

I am setting up WSP to provision VPS's for clients. I have created the template as per the documentation however, whenever I edit the unattend.xml file after the template has been created, it fails on VPS creation. Here is what I currently have in my unattend.xml:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="generalize">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" 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>#vm.Hostname.ToUpper()#
    </ComputerName>
      <RegisteredOwner>#user.FirstName# #user.LastName#
    </RegisteredOwner>
      <RegisteredOrganization>#user.CompanyName#
    </RegisteredOrganization>
    <ProductKey>mkey
    </ProductKey>
    <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <NetworkLocation>Work</NetworkLocation>
                <ProtectYourPC>1</ProtectYourPC>
                <SkipMachineOOBE>true</SkipMachineOOBE>
                <SkipUserOOBE>true</SkipUserOOBE>
        </OOBE>
    <OEMInformation>
                <Manufacturer>mycompany</Manufacturer>
                <Model>SMB Windows VPS</Model>
                <SupportHours>9am - 5pm | Mon - Fri</SupportHours>
                <SupportPhone>mynumber</SupportPhone>
                <SupportURL>mysite</SupportURL>
            </OEMInformation>
    </component>
        <component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
        </component>
        <component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
        </component>       
    </settings>
    <cpi:offlineImage cpi:source="wim:d:/sources/install.wim#Windows Server 2008 R2 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>



如果有人也可以提供我的详细信息如何将客户端的用户名传递给服务器,以及客户端在创建优秀的VPS时设置的密码。


If anyone can also provide me details on how to pass through the username for the client to the server, and the password the client sets when creating the VPS that would be excellent.

提前谢谢。

 

Chris

推荐答案


您好,

Hello,

我正在设置WSP为客户提供VPS。我已根据文档创建了模板,但是每当我在创建模板后编辑unattend.xml文件时,它就会在创建VPS时失败。这是我目前在unattend.xml中的内容:

I am setting up WSP to provision VPS's for clients. I have created the template as per the documentation however, whenever I edit the unattend.xml file after the template has been created, it fails on VPS creation. Here is what I currently have in my unattend.xml:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="generalize">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" 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>#vm.Hostname.ToUpper()#
    </ComputerName>
      <RegisteredOwner>#user.FirstName# #user.LastName#
    </RegisteredOwner>
      <RegisteredOrganization>#user.CompanyName#
    </RegisteredOrganization>
    <ProductKey>mkey
    </ProductKey>
    <OOBE>
                <HideEULAPage>true</HideEULAPage>
                <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
                <NetworkLocation>Work</NetworkLocation>
                <ProtectYourPC>1</ProtectYourPC>
                <SkipMachineOOBE>true</SkipMachineOOBE>
                <SkipUserOOBE>true</SkipUserOOBE>
        </OOBE>
    <OEMInformation>
                <Manufacturer>mycompany</Manufacturer>
                <Model>SMB Windows VPS</Model>
                <SupportHours>9am - 5pm | Mon - Fri</SupportHours>
                <SupportPhone>mynumber</SupportPhone>
                <SupportURL>mysite</SupportURL>
            </OEMInformation>
    </component>
        <component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
        </component>
        <component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
        </component>       
    </settings>
    <cpi:offlineImage cpi:source="wim:d:/sources/install.wim#Windows Server 2008 R2 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>



如果有人也可以提供我的详细信息如何将客户端的用户名传递给服务器,以及客户端在创建优秀的VPS时设置的密码。


If anyone can also provide me details on how to pass through the username for the client to the server, and the password the client sets when creating the VPS that would be excellent.

提前谢谢。

 

Chris

HI

请使用以下文件。 记得输入您的产品密钥。 

use this file below.  remember to enter your product key. 

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
  
  <!-- Template variables -->
  <ad:set name="architecture" value="amd64" /> <!-- "x86" for 32-bit OS editions and "amd64" for 64-bit OS editions -->
  <ad:set name="edition" value="Standard" /> <!-- Windows Server 2008 Edition: "Web", "Standard", "Enterprise" or "DataCenter" -->
  <ad:set name="serverCore" value="" /> <!-- "Core" if it is Server Core edition; otherwise "" (empty string) -->

  <settings pass="generalize">
    <component name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="#architecture#" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
    </component>
    <component name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="#architecture#" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
    </component>
  </settings>

  <settings pass="specialize">

    <component name="Microsoft-Windows-IE-ESC" processorArchitecture="#architecture#" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <IEHardenAdmin>false</IEHardenAdmin>
      <IEHardenUser>false</IEHardenUser>
    </component>

    <!-- Computer name and owner -->
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="#architecture#" 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>#vm.Hostname.ToUpper()#</ComputerName>
      <RegisteredOwner>#user.FirstName# #user.LastName#</RegisteredOwner>
      <RegisteredOrganization>#user.CompanyName#</RegisteredOrganization>
      <TimeZone>GMT Standard Time</TimeZone>
	  <ProductKey>ENTER-SPLA-KEY</ProductKey>
    </component>

    <!-- Networking settings -->
    <component name="Microsoft-Windows-TCPIP" processorArchitecture="#architecture#" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <Interfaces>

        <!-- External network -->
        <ad:if test="#isnotempty(external_nic.MacAddress)#">
          <Interface wcm:action="add">
            <Identifier>#external_nic.MacAddress#</Identifier>
            <Ipv4Settings>
              <DhcpEnabled>#external_nic.IsDHCP.ToString().ToLower()#</DhcpEnabled>
            </Ipv4Settings>
            <ad:if test="#not(external_nic.IsDHCP)#">
              <UnicastIpAddresses>
                <ad:foreach collection="#external_nic.IPAddresses#" var="ip" index="i">
                  <IpAddress wcm:action="add" wcm:keyValue="#i#">#ip.IPAddress#/#ip.SubnetMaskCidr#</IpAddress>
                </ad:foreach>
              </UnicastIpAddresses>
            </ad:if>
            <ad:if test="#isnotempty(external_nic.DefaultGateway)#">
              <Routes>
                <Route wcm:action="add">
                  <Identifier>0</Identifier>
                  <Prefix>0.0.0.0/0</Prefix>
                  <NextHopAddress>#external_nic.DefaultGateway#</NextHopAddress>
                  <Metric>20</Metric>
                </Route>
              </Routes>
            </ad:if>
          </Interface>
        </ad:if>

        <!-- Management network -->
        <ad:if test="#isnotempty(management_nic.MacAddress)#">
          <Interface wcm:action="add">
            <Identifier>#management_nic.MacAddress#</Identifier>
            <Ipv4Settings>
              <DhcpEnabled>#management_nic.IsDHCP.ToString().ToLower()#</DhcpEnabled>
            </Ipv4Settings>
            <ad:if test="#not(management_nic.IsDHCP)#">
              <UnicastIpAddresses>
                <ad:foreach collection="#management_nic.IPAddresses#" var="ip" index="i">
                  <IpAddress wcm:action="add" wcm:keyValue="#i#">#ip.IPAddress#/#ip.SubnetMaskCidr#</IpAddress>
                </ad:foreach>
              </UnicastIpAddresses>
            </ad:if>
            <ad:if test="#isnotempty(management_nic.DefaultGateway)#">
              <Routes>
                <Route wcm:action="add">
                  <Identifier>0</Identifier>
                  <Prefix>0.0.0.0/0</Prefix>
                  <NextHopAddress>#management_nic.DefaultGateway#</NextHopAddress>
                  <Metric>20</Metric>
                </Route>
              </Routes>
            </ad:if>
          </Interface>
        </ad:if>

        <!-- Private network -->
        <ad:if test="#isnotempty(private_nic.MacAddress)#">
          <Interface wcm:action="add">
            <Identifier>#private_nic.MacAddress#</Identifier>
            <Ipv4Settings>
              <DhcpEnabled>#private_nic.IsDHCP.ToString().ToLower()#</DhcpEnabled>
            </Ipv4Settings>
            <ad:if test="#not(private_nic.IsDHCP)#">
              <UnicastIpAddresses>
                <ad:foreach collection="#private_nic.IPAddresses#" var="ip" index="i">
                  <IpAddress wcm:action="add" wcm:keyValue="#i#">#ip.IPAddress#/#ip.SubnetMaskCidr#</IpAddress>
                </ad:foreach>
              </UnicastIpAddresses>
            </ad:if>
            <ad:if test="#isnotempty(private_nic.DefaultGateway)#">
              <Routes>
                <Route wcm:action="add">
                  <Identifier>0</Identifier>
                  <Prefix>0.0.0.0/0</Prefix>
                  <NextHopAddress>#private_nic.DefaultGateway#</NextHopAddress>
                  <Metric>20</Metric>
                </Route>
              </Routes>
            </ad:if>
          </Interface>
        </ad:if>

      </Interfaces>
    </component>

    <!-- DNS -->
    <component name="Microsoft-Windows-DNS-Client" processorArchitecture="#architecture#" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <DNSDomain>#vm.Domain#</DNSDomain>
      <Interfaces>

        <!-- External network DNS settings -->
        <ad:if test="#isnotempty(external_nic.MacAddress) and (isnotempty(external_nic.PreferredNameServer) or isnotempty(external_nic.AlternateNameServer))#">
          <Interface wcm:action="add">
            <Identifier>#external_nic.MacAddress#</Identifier>
            <DNSServerSearchOrder>
              <ad:if test="#isnotempty(external_nic.PreferredNameServer)#">
                <IpAddress wcm:action="add" wcm:keyValue="1">#external_nic.PreferredNameServer#</IpAddress>
              </ad:if>
              <ad:if test="#isnotempty(external_nic.AlternateNameServer)#">
                <IpAddress wcm:action="add" wcm:keyValue="2">#external_nic.AlternateNameServer#</IpAddress>
              </ad:if>
            </DNSServerSearchOrder>
          </Interface>
        </ad:if>

        <!-- Management network DNS settings -->
        <ad:if test="#isnotempty(management_nic.MacAddress) and (isnotempty(management_nic.PreferredNameServer) or isnotempty(management_nic.AlternateNameServer))#">
          <Interface wcm:action="add">
            <Identifier>#management_nic.MacAddress#</Identifier>
            <DNSServerSearchOrder>
              <ad:if test="#isnotempty(management_nic.PreferredNameServer)#">
                <IpAddress wcm:action="add" wcm:keyValue="1">#management_nic.PreferredNameServer#</IpAddress>
              </ad:if>
              <ad:if test="#isnotempty(management_nic.AlternateNameServer)#">
                <IpAddress wcm:action="add" wcm:keyValue="2">#management_nic.AlternateNameServer#</IpAddress>
              </ad:if>
            </DNSServerSearchOrder>
          </Interface>
        </ad:if>

        <!-- Private network DNS settings -->
        <ad:if test="#isnotempty(private_nic.MacAddress) and (isnotempty(private_nic.PreferredNameServer) or isnotempty(private_nic.AlternateNameServer))#">
          <Interface wcm:action="add">
            <Identifier>#private_nic.MacAddress#</Identifier>
            <DNSServerSearchOrder>
              <ad:if test="#isnotempty(private_nic.PreferredNameServer)#">
                <IpAddress wcm:action="add" wcm:keyValue="1">#private_nic.PreferredNameServer#</IpAddress>
              </ad:if>
              <ad:if test="#isnotempty(private_nic.AlternateNameServer)#">
                <IpAddress wcm:action="add" wcm:keyValue="2">#private_nic.AlternateNameServer#</IpAddress>
              </ad:if>
            </DNSServerSearchOrder>
          </Interface>
        </ad:if>

      </Interfaces>
    </component>
  </settings>

  <settings pass="oobeSystem">
    <component name="Microsoft-Windows-International-Core" processorArchitecture="#architecture#" 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="#architecture#" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <OOBE>
        <NetworkLocation>Work</NetworkLocation>
        <ProtectYourPC>1</ProtectYourPC>
        <HideEULAPage>true</HideEULAPage>
      </OOBE>
      <UserAccounts>
        <!-- Administrator account password -->
        <AdministratorPassword>
          <Value>#vm.AdministratorPassword#</Value>
          <PlainText>true</PlainText>
        </AdministratorPassword>
      </UserAccounts>
    </component>
  </settings>

  <cpi:offlineImage cpi:source="wim://waik32/wim/x32/install.wim##Windows Longhorn SERVER#toupper(serverCore)##toupper(edition)#" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>


这篇关于Unattend.xml模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆