天天看點

Unattend.xml應答檔案制作(WISM) - CasonChan

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

Unattend.xml應答檔案制作(WISM) - CasonChan