Feed Facebook

A-A+

在 Windows 7 中自訂預設的使用者設定檔

2011年04月28日 Windows 7, 研究資源 暫無評論

您可以在傳送至 Sysprep.exe 工具的 Unattend.xml 回應檔案中,使用下列 CopyProfile 參數來自訂本機預設的使用者設定檔:

Microsoft-Windows-Shell-Setup\CopyProfileWindows7

如果要執行這項操作,請依照下列步驟執行:

  1. 使用內建本機系統管理員帳戶並登入電腦。
    注意您不能在此程序中使用網域帳戶。這是因為在執行 sysprep 時會刪除該設定檔,並且在影像第一次開機的特殊階段中複製設定檔。如果您使用網域帳戶,則複製設定檔程序將複製具有最新時間/日期戳記的設定檔。
  2. 開啟 [使用者帳戶] 控制面板,除了保留一個用於登入的系統管理員層級使用者帳戶外,移除所有新增的使用者帳戶。注意 如果找到多個使用者設定檔,Windows sysprep 可能會選擇將非預期的設定檔複製到預設的使用者設定檔。如需詳細資訊,請按一下下面的文件編號,檢視「Microsoft 知識庫」中的文件:
    2101557 所有預設使用者設定檔的自訂內容皆遺失
  3. 設定您要複製到預設使用者設定檔的設定。其中包括桌面設定、我的最愛和 [開始] 功能表選項。注意 在 Windows 7 中自訂 [開始] 功能表和 [工作列] 會受到某些限制。如需詳細資訊,請造訪下列 Microsoft 網站:
    http://blogs.technet.com/askcore/archive/2010/03/16/how-to-customize-the-windows-7-start-menu-and-taskbar-using-unattend-xml.aspx
  4. 建 立包含「複製設定檔」參數的 Unattend.xml 檔案。透過使用此「複製設定檔」參數,可將目前已登入之使用者的設定複製到預設的使用者設定檔。此參數在特定的傳送中必須設定為「true」。下列是使用 適用於 Windows 7 Enterprise x86 版本的 Windows 7「Windows 系統影像管理員」(WSIM) 所建立之 .xml 檔案中的 CopyProfile 屬性範例:

    <?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"> <CopyProfile>true</CopyProfile> </component> </settings> <cpi:offlineImage cpi:source="wim://<computerName>/g$sources/install.wim#Windows 7 ENTERPRISE" xmlns:cpi="urn:schemas-microsoft-com:cpi" /> </unattend>
    使 用「Windows 系統影像管理員」工具建立 Unattend.xml 檔案。「Windows 系統映像管理員」工具為「Windows 自動化安裝套件」(Windows AIK) 的一部分。如需有關 Windows AIK 的詳細資訊,請造訪下列 Microsoft 網站:

    http://technet.microsoft.com/zh-tw/library/dd349343(WS.10).aspx

    如需有關如何建立回應檔案的詳細資訊,請參閱 Windows AIK 隨附的說明資訊,然後造訪下列 Microsoft 網站:

    http://technet.microsoft.com/zh-tw/library/dd744394(WS.10).aspx
  5. 在提高權限的命令提示字元中,輸入下列命令,然候按下 ENTER:
    %systemroot%\system32\sysprep\sysprep.exe /oobe /reboot /generalize /unattend:c:\answerfile\unattend.xml

    Sysprep.exe 位於 %systemdrive%\Windows\System32\sysprep directory。如需有關 Sysprep 的詳細資訊,請造訪下列 Microsoft 網站:

    http://technet.microsoft.com/zh-tw/library/cc766049(WS.10).aspx

    注意 您必須使用 /generalize 參數,以便使用 Copy Profile 參數。/unattend 選項可以用來指向所需的 Unattend.xml 檔案。因此,此範例中的 Unattend.xml 檔案是位於 c:\answerfile 資料夾中。

    如果要確認 CopyProfile 命令是否已順利完成,請開啟下列檔案:

    %systemroot%\panther\unattendgc\setupact.log

    搜尋類似下列的文字 (位於「特定」的傳送):

    [shell unattend] CopyProfileDirectory from c:\Users\Administrator succeeded.
    [shell unattend] CopyProfile succeeded.

    請注意,這行文字可確認 CopyProfile 命令是否成功,以及已複製到預設使用者設定檔的使用者設定檔。

  6. 擷取影像。
  7. 部署影像。

注意事項

  • 執行全新 Windows 安裝或 Sysprep 工具時,將會刪除內建系統管理員帳戶設定檔。而在刪除內建系統管理員帳戶之前會先處理 CopyProfile 設定。因此,您所建立的任何自訂內容都會顯示於新的使用者帳戶設定檔中。其中包括了內建系統管理員帳戶設定檔設定。
  • 並非所有自訂內容都會傳播至新的設定檔中。某些設定已在進行新的使用者登入過程時重設。如果要設定那些設定,請使用「群組原則」設定或指令碼處理。

使用「自動影像組建」和「部署系統」時的注意事項

將自訂設定複製到預設使用者設定檔 時,Windows Vista、Windows Server 2008、Windows 7 和 Windows Server 2008 R2 中的行為和執行個體皆已變更。因此,在控制設定檔複製之執行個體的回應檔案中,其設定位置也必定不同。

使用 Microsoft Deployment Toolkit 或 System Center Configuration Manager 時,執行 Sysprep 命令不需要 CopyProfile 設定。將影像部署至磁碟後,以及在執行 Sysprep 命令後首次啟動作業系統之前,這些工具通常會取代或變更 Unattend.xml。因此,在 Microsoft Deployment Toolkit 或 System Center Configuration Manager 部署程序中所使用的 Unattend.xml 檔案必須包含 CopyProfile 設定。

注意 在影像組建的過程中從 Windows Vista、Windows 7、Windows Server 2008 或 Windows Server 2008 R2 安裝媒體來執行安裝時,如果您設定 CopyProfile 設定為 true,可能會不小心將系統管理員設定檔設定複製到預設使用者設定檔中。系統管理員設定檔設定通常可在安裝媒體中的 Install.wim 檔案中找到。

標籤:

給我留言