Unattend.xml應答文件制作(WISM)


將制作好的應答文件unattend.xml拷貝到模板機sysprep目錄下,然后在cmd下運行 (unattend.xml文件可自定義名稱)

  sysprep /generalize /oobe /shutdown /unattend:Unattend.xml

 

應答文件設置項說明:

4.specialize

   amd64_Microsoft-Windows-Security-SPP-UX_neutral:Skip AutoActivation:true  跳過自動激活

   amd64_Microsoft-Windows-Shell-Setup_neutral:CpmputerName,TimeZone:設置計算機名(*表示自動命名),時區

   注:ComputerName要生效必須注意如下配置:

        1)如果設置 SkipmachineOOBE為true,則要對 windowsPE/amd64_Microsoft-Windows-Setup_neutral/UserData 進行設置

    2)如果設置 SkipmachineOOBE為false,則設置其上面的 HideEULAPage設置等,不需要再設置windowsPE/amd64_Microsoft-Windows-Setup_neutral/UserData

   

 

   amd64_Microsoft-Windows-UnattendedJoin_neutral/Identification:JoinWorkgroup 設置工作組OK,加域單獨設置此處還未生效

 

7.oobeSystem

   amd64_Microsoft-Windows-International-Core_neutral:設置語言

 “zh-CN”,繁體中文為“zh-HK”,英文為“en-US”
   InputLocale用於設置輸入語言,此處用“en-US”;
   LayerDriver為鍵盤的種類,除了日文和韓文,應該為“1”;
   SystemLocale用於設置運行非Unicode程序時系統的默認語言;
   UILanguage用於設置用戶界面的語言;
   UILanguageFallback表示當UILanguage選用小地區時,若程序沒有該種語言,則跳到UILanguageFallback;
   UserLocale指地區選項,包括日期、時間、數字等格式。

    

     設置用戶自動登錄;設置管理員密碼(下面兩項都需要設置,AutoLogon的Administrator密碼和AdministratorPassword的密碼都要設置相同)

     測試結果:如果只設置了 AutoLogon,則跳出“更改密碼”界面;如果AutoLogon的Administrator密碼為 空,AdministratorPassword項未啟用,則跳出“更改密碼”界面;如果不設置如果AutoLogon的Administrator密碼 為空,AdministratorPassword設置了相應密碼,則提示密碼錯誤。

    amd64_Microsoft-Windows-Shell-Setup_neutral/AutoLogon/Password 

    amd64_Microsoft-Windows-Shell-Setup_neutral/UserAccounts/AdministratorPassword

   

   

 

    添加登陸后執行腳本(bat或ps1均可,需要管理員權限):

    amd64_Microsoft-Windows-Shell-Setup_neutral/FirstLogonCommands 新建 AsynchronousCommand

    注:FirstLogonCommands 下的腳本只在第一次登錄時運行;還有一點是如果第一次運行PowerShell腳本的話,會不成功,因為默認情況下是禁止PowerShell腳本運行 的,所以第一次只能先運行批處理(Powershell.exe Set-ExecutionPolicy unrestricted -force),然后再調用PowerShell腳本

    直接運行PowerShell腳本,CommandLine格式如下:

    %WINDIR%\System32\WindowsPowerShell\v1.0\PowerShell.exe c:\m.ps1

    

    amd64_Microsoft-Windows-Shell-Setup_neutral/LogonCommands 新建 AsynchronousCommand

    注:LogonCommands下的命令會在每次登陸時都運行一次

    

    

 

   amd64_Microsoft-Windows-Shell-Setup_neutral/OOBE:跳過 MachineOOBE,即跳過Windows歡迎界面(user-account creation, language, and time-zone settings will not be configured)

   HideEULAPage:true 隱藏協議許可界面
   HideWirelessSetupInOOBE:true 跳過無線網絡設置
   NetworkLocation:work 網絡類型
   ProtectYourPC:1自動獲取所有補丁 2獲取重要補丁 3不自動升級
   SkipMachineOOBE:True(注:因為設置了 SkipMachineOOBE為True,所以上面4項不需要再設置)

   

 

===============================================================================

第一次自動登錄-設置管理員密碼-時區-語言-執行一次PowerShell腳本-計算機名稱(已測)

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="oobeSystem">
<component name="Microsoft-Windows-International-Core" 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">
<InputLocale>zh-CN</InputLocale>
<SystemLocale>zh-CN</SystemLocale>
<UILanguage>zh-CN</UILanguage>
<UILanguageFallback>zh-CN</UILanguageFallback>
<UserLocale>zh-CN</UserLocale>
</component>
<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">
<AutoLogon>
<Password>
<PlainText>false</PlainText>
<Value>YgBvAGMALgAxADIAMwBQAGEAcwBzAHcAbwByAGQA</Value>
</Password>
<Enabled>true</Enabled>
<LogonCount>1</LogonCount>
<Username>administrator</Username>
</AutoLogon>
<OOBE>
<SkipMachineOOBE>true</SkipMachineOOBE>
</OOBE>
<UserAccounts>
<AdministratorPassword>
<Value>YgBvAGMALgAxADIAMwBBAGQAbQBpAG4AaQBzAHQAcgBhAHQAbwByAFAAYQBzAHMAdwBvAHIAZAA=</Value>
<PlainText>false</PlainText>
</AdministratorPassword>
</UserAccounts>
<FirstLogonCommands>
<SynchronousCommand wcm:action="add">
<Order>1</Order>
<CommandLine>%WINDIR%\System32\WindowsPowerShell\v1.0\PowerShell.exe c:\m.ps1</CommandLine>
</SynchronousCommand>
</FirstLogonCommands>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Security-SPP-UX" 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">
<SkipAutoActivation>true</SkipAutoActivation>
</component>
<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>PCname1</ComputerName>
<TimeZone>China Standard Time</TimeZone>
</component>
</settings>
<cpi:offlineImage cpi:source="catalog:e:/isotest/win2008r2_en_windows server 2008 r2 serverenterprise.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

 

=========================================================================

以下未測試: 


windowsPE:Microsoft-Windows-International-Core-WinPE 設置PE階段的語言類型

windowsPE:Microsoft-Windows-Setup 此處設置的fullname(用戶名),organization(組織)只在PE階段有效
windowsPE:Microsoft-Windows-Setup imageinstall:osimage:安裝到可用分區,默認false,安裝時自行選擇

specialize: Microsoft-Windows-IE-InternetExplorer IE設置

OOBE:Microsoft-Windows-Shell-Setup/UserAccounts/ LocalAccounts 新建用戶

 

配置用戶默認配置(其他所有登陸到該計算機的用戶都使用該配置文件):
在 4specialize階段:Microsoft-windows-Shell-Setup | copyProfile 設置為true,在封裝的時候會將當前用戶的默認配置文件復制到默認用戶的配置文件 

跳過重置激活期限(slmgr /dlv):
在 4specialize階段:Microsoft-windows-Security-SPP_neutral |SkipRearm :1

編輯注冊表:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform\SkipRearm將其從0設置為1

注:

  You must make sure that the <SkipRearm> setting is removed from the final unattended file that is used to deploy computers in a production environment. If <SkipRearm> is not removed from the unattended file that is used to deploy computers in a production environment, the KMS current client count does not increase for new clients that are added to the network.

  The Windows Software Licensing Rearm program restores the Windows system to the original licensing state. All licensing and registry data related to activation is either removed or reset. Also, any grace period timers are reset.

     From:http://support.microsoft.com/kb/929828


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM