建立工作順序以擷取 OSCreate a task sequence to capture an OS

適用於: Configuration Manager (最新分支)Applies to: Configuration Manager (current branch)

使用工作順序將 OS 部署到 Configuration Manager 中的電腦時,電腦會安裝在工作順序中指定的 OS 映像。When you use a task sequence to deploy an OS to a computer in Configuration Manager, the computer installs the OS image that you specify in the task sequence. 您可以自訂 OS 映像,使其包含特定驅動程式、應用程式和軟體更新。You can customize the OS image so it includes specific drivers, applications, and software updates. 請先使用建置和擷取工作順序來建立參照電腦。First use a build and capture task sequence to build a reference computer. 然後從該參照電腦擷取 OS 映像。Then capture the OS image from that reference computer. 如果已經有用於擷取的參照電腦,請建立自訂工作順序以擷取 OS。If you already have a reference computer available to capture, create a custom task sequence to capture the OS.

關於建置和擷取工作順序About the build and capture task sequence

建置和擷取工作順序:The build and capture task sequence:

  • 分割並格式化參照電腦Partitions and formats the reference computer
  • 安裝 OSInstalls the OS
  • 安裝 Configuration Manager 用戶端Installs the Configuration Manager client
  • 安裝應用程式Installs applications
  • 套用軟體更新Applies software updates
  • 從參照電腦擷取 OSCaptures the OS from the reference computer

在部署建置和擷取工作順序之前,在發佈點上必須先有與工作順序建立關聯的套件,例如應用程式。The packages associated with the task sequence, such as applications, must be available on distribution points before you deploy the build and capture task sequence.

需求Requirements

建立工作順序以安裝 OS 之前,下列元件必須先準備就緒:Before you create a task sequence to install an OS, make sure the following components are in place:

必要Required

必要 (如果有用到)Required (if used)

建立組建和擷取工作順序Create a build and capture task sequence

請使用下列程序,以使用工作順序建置參照電腦和擷取 OS。Use the following procedure to use a task sequence to build a reference computer and capture the OS.

  1. 在 Configuration Manager 主控台中,移至 [軟體程式庫] 工作區,展開 [作業系統] ,然後選取 [工作順序] 節點。In the Configuration Manager console, go to the Software Library workspace, expand Operating Systems, and then select the Task Sequences node.

  2. 在功能區 [首頁] 索引標籤的 [建立] 群組中,選取 [建立工作順序] 來啟動 [建立工作順序精靈]。On the Home tab of the ribbon, in the Create group, select Create Task Sequence to start the Create Task Sequence Wizard.

  3. 在 [建立新的工作順序] 頁面上,選取 [建立並擷取參照作業系統映像] 。On the Create a New Task Sequence page, select Build and capture a reference operating system image.

  4. 在 [工作順序資訊] 頁面上指定下列設定:On the Task Sequence Information page, specify the following settings:

    • 工作順序名稱:指定識別工作順序的名稱。Task sequence name: Specify a name that identifies the task sequence.

    • 描述:為工作順序指定選擇性描述。Description: Specify an optional description for the task sequence. 例如,描述工作順序所建立的 OS。For example, describe the OS that the task sequence creates.

    • 開機映像:指定要與此工作順序搭配使用的開機映像。Boot image: Specify the boot image to use with this task sequence.

      重要

      開機映像的架構必須與目的地電腦的硬體架構相容。The architecture of the boot image must be compatible with the hardware architecture of the destination computer.

  5. 在 [安裝 Windows] 頁面上指定下列設定:On the Install Windows page, specify the following settings:

    • 映像套件:指定 OS 映像套件,其中包含安裝 OS 所需的檔案。Image package: Specify the OS image package, which contains the required files to install the OS.

    • 映像索引:指定要安裝在映像中的 OS 索引。Image index: Specify the index of the OS to install in the image. 如果 OS 映像包含多個版本,則選取想要安裝的版本。If the OS image contains multiple versions, select the version that you want to install.

    • 產品金鑰:視需要指定所要安裝 Windows OS 的產品金鑰。Product key: If necessary, specify the product key for the Windows OS to install. 您可以指定編碼的大量授權金鑰和標準產品金鑰。You can specify encoded volume license keys and standard product keys. 如果使用未編碼的產品金鑰,則會以每五個字元為一組,之間以虛線 (-) 來分隔。If you use a non-encoded product key, separate each group of five characters with a dash (-). 例如:XXXXX-XXXXX-XXXXX-XXXXX-XXXXXFor example: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

    • 伺服器授權模式:若有必要,請指定伺服器授權為 [按照基座] 、[按照伺服器] ,或者不指定授權。Server licensing mode: If necessary, specify that the server license is Per seat, Per server, or that no license is specified. 如果伺服器授權為 [按照伺服器] ,請同時指定伺服器連線數目上限。If the server license is Per server, also specify the maximum number of server connections.

    • 指定要如何為已部署的 OS 設定系統管理員帳戶:Specify how to configure the administrator account for the deployed OS:

      • 隨機產生本機系統管理員密碼,並在所有支援的平台上停用帳戶:為本機系統管理員帳戶建立隨機密碼。Randomly generate the local administrator password and disable the account on all supported platforms: Create a random password for the local administrator account. Windows 設定完成時,請停用帳戶。Disable the account when the Windows is set up.

      • 啟用帳戶並指定本機系統管理員密碼:在部署此 OS 的所有電腦上,使用相同的本機系統管理員帳戶密碼。Enable the account and specify the local administrator password: Use the same password for the local administrator account on all computers where you deploy this OS.

  6. 在 [設定此網路] 頁面指定下列設定:On the Configure Network page, specify the following settings:

    • 加入工作群組:指定是否在部署 OS 時,將目的地電腦新增至工作群組。Join a workgroup: Specify whether to add the destination computer to a workgroup when the OS is deployed.

    • 加入網域:指定是否在部署 OS 時,將目的地電腦新增至網域。Join a domain: Specify whether to add the destination computer to a domain when the OS is deployed. 在 [網域] 中,指定網域名稱。In Domain, specify the name of the domain.

      重要

      您可以進行瀏覽以尋找本機樹系中的網域。You can browse to locate domains in the local forest. 指定遠端樹系的網域名稱。Specify the domain name for a remote forest.

      您也可以指定組織單位 (OU)。You can also specify an organizational unit (OU). 這是選用設定,會指定要建立電腦帳戶所在 OU 的 LDAP X.500 辨別名稱 (如果帳戶尚未存在)。This setting is optional, and specifies the LDAP X.500 distinguished name of the OU in which to create the computer account, if it doesn't already exist.

    • 帳戶:指定具有加入指定網域權限之帳戶的使用者名稱和密碼。Account: Specify the user name and password for the account that has permissions to join the specified domain. 例如:domain\user%variable%For example: domain\user or %variable%.

      重要

      如果計畫在部署期間移轉網域設定或工作群組設定,請務必在這裡輸入適當的網域認證。If you plan to migrate either the domain settings or the workgroup settings during the deployment, make sure you enter the appropriate domain credentials here.

  7. 在 [安裝 Configuration Manager] 頁面上,指定 Configuration Manager 用戶端套件。On the Install Configuration Manager page, specify the Configuration Manager client package. 此套件包含安裝 Configuration Manager 用戶端所需的來源檔案。This package contains the source files to install the Configuration Manager client. 此外,也請指定安裝用戶端所需的任何其他屬性。Also specify any additional properties needed to install the client.

    如需詳細資訊,請參閱關於用戶端安裝內容For more information, see About client installation properties.

  8. 在 [包含更新] 頁面上,指定要安裝必要的軟體更新、所有軟體更新,或不安裝軟體更新。On the Include Updates page, specify whether to install required software updates, all software updates, or no software updates. 如果您指定安裝軟體更新,Configuration Manager 只會將目標軟體更新安裝至目的地電腦為其成員的集合。If you specify to install software updates, Configuration Manager installs only those software updates that are targeted to the collections that the destination computer is a member of.

  9. 在 [安裝應用程式] 頁面上,指定要安裝在目的地電腦上的應用程式。On the Install Applications page, specify the applications to install on the destination computer. 如果您指定多個應用程式,也可以指定工作順序在特定應用程式安裝失敗時繼續執行。If you specify multiple applications, you can also specify that the task sequence continues if the installation of a specific application fails.

    注意

    [系統準備] 頁面會顯示在精靈的下一個畫面中,但已不再使用。The System Preparation page appears next in the wizard, but it's no longer used. 選取 [下一步] 以繼續進行操作。Select Next to continue.

  10. 在 [映像內容] 頁面上,指定下列 OS 映像的設定:On the Images Properties page, specify the following settings for the OS image:

    • 建立者:指定使用者名稱以註記為 OS 映像的建立者。Created by: Specify the name of the user to note as the creator of the OS image.

    • 版本:指定與 OS 映像建立關聯的版本號碼。Version: Specify your version number that's associated with the OS image. 此屬性不一定要是 OS 版本,因為網站會分開儲存該值。This attribute doesn't need to be the OS version, as the site stores that value separately.

    • 描述:指定 OS 映像的描述。Description: Specify your description of the OS image.

  11. 在 [擷取映像] 頁面上指定下列設定:On the Capture Image page, specify the following settings:

    • 路徑:指定 Configuration Manager 應儲存輸出映像檔 (.wim) 的共用網路資料夾。Path: Specify a shared network folder where Configuration Manager should store the output image file (.wim). 此檔案內含的 OS 映像,取決於在此精靈中指定的設定。This file contains the OS image that's based on the settings you specify in this wizard. 如果指定內含現有 .WIM 檔案的資料夾,就會覆寫該檔案。If you specify a folder that contains an existing .WIM file, it's overwritten.

    • 帳戶:指定具有儲存映像之網路共用權限的 Windows 帳戶。Account: Specify the Windows account that has permissions to the network share where the image is stored.

  12. 完成精靈。Complete the wizard.

若要將其他步驟新增至工作順序,請加以選取,然後選擇 [編輯] 。To add additional steps to the task sequence, select it, and choose Edit. 如需如何編輯工作順序的詳細資訊,請參閱使用工作順序編輯器For more information about how to edit a task sequence, see Use the task sequence editor.

請使用下列方法之一將工作順序部署至參照電腦:Deploy the task sequence to a reference computer in one of the following ways:

  • 如果參照電腦已經是 Configuration Manager 用戶端,請將建置和擷取工作順序部署至包含參照電腦的集合。If the reference computer is already a Configuration Manager client, deploy the build and capture task sequence to a collection that contains the reference computer. 如需詳細資訊,請參閱 Deploy a task sequenceFor more information, see Deploy a task sequence.

  • 如果參照電腦不是 Configuration Manager 用戶端,或如果您想要在參照電腦上手動執行工作順序,請使用 [建立工作順序媒體精靈] 以建立可開機媒體。If the reference computer isn't a Configuration Manager client, or if you want to manually run the task sequence on the reference computer, use the Create Task Sequence Media Wizard to create bootable media. 如需詳細資訊,請參閱建立可開機媒體For more information, see Create bootable media.

擷取映像後,就可以將其部署到其他電腦。After you capture the image, you can deploy it to other computers. 如需如何部署已擷取 OS 映像的詳細資訊,請參閱建立工作順序以安裝作業系統For more information about how to deploy the captured OS image, see Create a task sequence to install an OS.

從現有的參照電腦擷取Capture from an existing reference computer

如果已經有要擷取的參照電腦,請建立僅會從參照電腦擷取 OS 的工作順序。When you already have a reference computer ready to capture, create a task sequence that only captures the OS from the reference computer. 使用 [擷取作業系統映像] 工作順序步驟,從參照電腦擷取一或多個映像,並將其存放在指定網路共用上的映像檔 (.wim) 中。Use the Capture Operating System Image task sequence step to capture one or more images from a reference computer and store them in an image file (.wim) on the specified network share. 使用開機映像在 Windows PE 中啟動參照電腦。Start the reference computer in Windows PE with a boot image. 工作順序會將參照電腦上的每個硬碟,擷取為 .wim 檔案內的個別映像。The task sequence captures each hard drive on the reference computer as a separate image within the .wim file. 如果參照的電腦中有多個磁碟機,則所產生的 .wim 檔案將包含每個磁碟區的個別映像。If the referenced computer has multiple drives, the resulting .wim file contains a separate image for each volume. 此工作順序只會擷取格式化成 NTFS 或 FAT32 的磁碟區。It only captures volumes that are formatted as NTFS or FAT32. 會略過其他格式的磁碟區或 USB 磁碟區。It skips volumes with other formats or USB volumes.

請使用下列程序,從現有的參照電腦擷取 OS 映像:Use the following procedure to capture an OS image from an existing reference computer:

  1. 在 Configuration Manager 主控台中,移至 [軟體程式庫] 工作區,展開 [作業系統] ,然後選取 [工作順序] 節點。In the Configuration Manager console, go to the Software Library workspace, expand Operating Systems, and then select the Task Sequences node.

  2. 在功能區的 [首頁] 索引標籤上,選取 [建立] 群組中的 [建立工作順序] 。On the Home tab of the ribbon, in the Create group, select Create Task Sequence. 這個動作會啟動 [建立工作順序精靈]。This action starts the Create Task Sequence Wizard.

  3. 在 [建立新的工作順序] 頁面上,選取 [建立新的自訂工作順序] 。On the Create a New Task Sequence page, select Create a new custom task sequence.

  4. 在 [工作順序資訊] 頁面上,指定工作順序的名稱。On the Task Sequence Information page, specify a name for the task sequence. (選擇性) 為工作順序新增描述。Optionally add a description for the task sequence.

  5. 指定工作順序的開機映像。Specify a boot image for the task sequence. Configuration Manager 會使用此開機映像,以 Windows PE 啟動參照電腦。Configuration Manager uses this boot image to start the reference computer with Windows PE. 如需詳細資訊,請參閱管理開機映像For more information, see Manage boot images.

  6. 完成精靈。Complete the wizard.

  7. 在 [工作順序] 節點中,選取新的工作順序。In the Task Sequences node, select the new task sequence. 接著,在功能區的 [首頁] 索引標籤的 [工作順序] 群組中選取 [編輯] 。Then on the Home tab of the ribbon, in the Task Sequence group, select Edit. 此動作會開啟工作順序編輯器。This action opens the task sequence editor.

  8. 如果參照電腦上已安裝 Configuration Manager 用戶端:If the Configuration Manager client is installed on the reference computer:

    前往 [新增] 功能表,選取 [映像] ,然後選擇 準備 ConfigMgr 用戶端以進行擷取Go to the Add menu, select Images, and then choose Prepare ConfigMgr Client for Capture. 此步驟會將參照電腦上的 Configuration Manager 用戶端一般化。This step generalizes the Configuration Manager client on the reference computer.

    注意

    工作順序不支援解除安裝 Configuration Manager 用戶端。The task sequence doesn't support uninstalling the Configuration Manager client.

  9. 前往 [新增] 功能表,選取 [映像] ,然後選擇 準備 Windows 以進行擷取Go to the Add menu, select Images, and choose Prepare Windows for Capture. 此步驟會執行 Sysprep,然後讓電腦在重新開機時進入為工作順序指定的 Windows PE 開機映像。This step runs Sysprep, and then restarts the computer to the Windows PE boot image specified for the task sequence. 若要順利完成此動作,請勿將參照電腦加入網域。For this action to complete successfully, don't join the reference computer to a domain.

  10. 前往 [新增] 功能表,選取 [映像] ,然後選擇 擷取作業系統映像Go to the Add menu, select Images, and choose Capture Operating System Image. 此步驟將只從 Windows PE 執行,以擷取參照電腦上的硬碟。This step only runs from Windows PE to capture the hard drives on the reference computer. 進行以下設定:Configure the following settings:

    • 名稱描述:(選擇性) 您可以變更工作順序步驟的名稱,並提供描述。Name and Description: Optionally, you can change the name of the task sequence step and provide a description.

    • 目的地:指定儲存輸出 .WIM 檔案的共用網路資料夾。Destination: Specify a shared network folder where the output .WIM file is stored. 此檔案內含的 OS 映像,取決於利用此精靈所指定的設定。This file contains the OS image based on the settings that you specify by using this wizard. 如果指定內含現有 .WIM 檔案的資料夾,就會覆寫該檔案。If you specify a folder that contains an existing .WIM file, it's overwritten.

    • 描述版本建立者:(選擇性) 提供要擷取之映像的詳細資料。Description, Version, and Created by: Optionally, provide details about the image to capture.

    • 擷取作業系統映像帳戶:指定具有您指定之網路共用權限的 Windows 帳戶。Capture operating system image account: Specify the Windows account that has permissions to the network share you specified. 選取 [設定] 以指定該 Windows 帳戶的名稱。Select Set to specify the name of that Windows account.

選取 [確定] 以儲存變更並關閉工作順序編輯器。Select OK to save your changes and close the task sequence editor.

請使用下列方法之一將工作順序部署至參照電腦:Deploy the task sequence to a reference computer in one of the following ways:

  • 如果參照電腦已經是 Configuration Manager 用戶端,請將擷取工作順序部署至包含參照電腦的集合。If the reference computer is already a Configuration Manager client, deploy the capture task sequence to a collection that contains the reference computer. 如需詳細資訊,請參閱 Deploy a task sequenceFor more information, see Deploy a task sequence.

  • 如果參照電腦不是 Configuration Manager 用戶端,或如果想要在參照電腦上手動執行工作順序,則請使用 [建立工作順序媒體精靈] 以建立擷取媒體。If the reference computer isn't a Configuration Manager client, or if you want to manually run the task sequence on the reference computer, use the Create Task Sequence Media Wizard to create capture media. 如需詳細資訊,請參閱建立擷取媒體For more information, see Create capture media.

擷取映像後,就可以將其部署到其他電腦。After you capture the image, you can deploy it to other computers. 如需如何部署已擷取 OS 映像的詳細資訊,請參閱建立工作順序以安裝作業系統For more information about how to deploy the captured OS image, see Create a task sequence to install an OS.

範例工作順序Example task sequence

當在建立用於建置和擷取 OS 映像的工作順序時,請使用下表作為指南。Use the following table as a guide as you create a task sequence that builds and captures an OS image. 資料表會協助您決定工作順序步驟的一般順序,以及如何將這些步驟組織並結構化到邏輯群組。The table helps you decide the general sequence for your task sequence steps, and how to organize and structure those steps into logical groups. 您建立的工作順序可能會與此範例不同。The task sequence that you create may vary from this sample. 該工作順序可能會包含較多或較少的步驟和群組。It can contain more or less steps and groups.

注意

請一律使用 [建立工作順序精靈] 來建立此類型的工作順序。Always use the Create Task Sequence Wizard to create this type of task sequence.

此精靈新增至工作順序的步驟名稱會與手動新增相同步驟時所看到名稱略有不同。The wizard adds steps to the task sequence with slightly different names that what you'd see if you manually add the same steps.

群組:建置參照機器Group: Build the Reference Machine

這個群組包含建置參照電腦時所需的動作。This group contains the actions necessary to build a reference computer.

工作順序步驟Task sequence step 說明Description
在 Windows PE 中重新啟動Restart in Windows PE 將目的地電腦重新開機至指派給工作順序的開機映像。Restart the destination computer to the boot image assigned to the task sequence. 此步驟中會顯示訊息給使用者,指出電腦將會重新啟動以便繼續進行安裝。This step displays a message to the user that the computer will be restarted so that the installation can continue.

此步驟使用唯讀 _SMSTSInWinPE 工作順序變數。This step uses the read-only _SMSTSInWinPE task sequence variable. 如果相關聯的值等於 false,則工作順序步驟會繼續。If the associated value equals false, then the task sequence step continues.
分割磁碟 0 – BIOSPartition Disk 0 - BIOS 在 BIOS 模式中分割並格式化目的地電腦上的硬碟。Partition and format the hard drive on the destination computer in BIOS mode. 預設的磁碟編號為 0The default disk number is 0.

此步驟使用數個唯讀工作順序變數。This step uses several read-only task sequence variables. 例如,此步驟只會在 Configuration Manager 用戶端的快取不存在時執行,而如果電腦設定為 UEFI,則不會執行。For example, it only runs if the Configuration Manager client cache doesn't exist, and doesn't run if the computer is configured for UEFI.
分割磁碟 0 - UEFIPartition Disk 0 - UEFI 在 UEFI 模式中分割並格式化目的地電腦上的硬碟。Partition and format the hard drive on the destination computer in UEFI mode. 預設的磁碟編號為 0The default disk number is 0.

此步驟使用數個唯讀工作順序變數。This step uses several read-only task sequence variables. 例如,此步驟只會在 Configuration Manager 用戶端的快取不存在時執行,且只有在電腦設定為 UEFI 時才會執行。For example, it only runs if the Configuration Manager client cache doesn't exist, and only runs if the computer is configured for UEFI.
套用作業系統Apply Operating System 在目的地電腦上安裝指定的 OS 映像。Install the specified OS image on the destination computer. 此步驟會先刪除該磁碟區上 (除了 Configuration Manager 特定控制檔案之外) 的任何檔案。This step first deletes all files on the volume, other than Configuration Manager-specific control files. 然後,它會將 WIM 檔案中包含的所有磁碟區映像套用至目標電腦上相對應的循序磁碟區。It then applies all volume images contained in the WIM file to the corresponding sequential disk volume on the target computer.
套用 Windows 設定Apply Windows Settings 設定目的地電腦的 Windows 設定。Configure the Windows settings for the destination computer.
套用網路設定Apply Network Settings 指定目的地電腦的網路或工作群組設定資訊。Specify the network or workgroup configuration information for the destination computer.
套用裝置驅動程式Apply Device Drivers 在部署 OS 時一併比對並安裝驅動程式。Match and install drivers as part of this OS deployment. 如需詳細資訊,請參閱自動套用驅動程式For more information, see Auto Apply Drivers.

此步驟使用唯讀 _SMSTSMediaType 工作順序變數。This step uses the read-only _SMSTSMediaType task sequence variable. 如果相關聯的值不等於 FullMedia,則不會執行此步驟。If the associated value doesn't equal FullMedia, this step doesn't run.
安裝 Windows 和 Configuration ManagerSetup Windows and Configuration Manager 安裝 Configuration Manager 用戶端軟體。Install the Configuration Manager client software. Configuration Manager 會安裝並註冊 Configuration Manager 用戶端 GUID。Configuration Manager installs and registers the Configuration Manager client GUID. 包含任何必要的安裝屬性Include any necessary Installation properties.
安裝更新Install Updates 指定如何在目的地電腦上安裝軟體更新。Specify how software updates are installed on the destination computer. 直到此步驟執行之後,才會評估目的地電腦是否有適用的軟體更新。The destination computer isn't evaluated for applicable software updates until this step runs. 此時,評估會類似於任何其他由 Configuration Manager 管理的用戶端。At that point, the evaluation is similar to any other Configuration Manager-managed client. 如需詳細資訊,請參閱安裝軟體更新For more information, see Install Software Updates.

此步驟使用唯讀 _SMSTSMediaType 工作順序變數。This step uses the read-only _SMSTSMediaType task sequence variable. 如果相關聯的值不等於 FullMedia,則不會執行此步驟。If the associated value doesn't equal FullMedia, this step doesn't run.
安裝應用程式Install Applications 指定要在參照電腦上安裝的任何應用程式。Specifies any applications to install on the reference computer.

群組:擷取參考機器Group: Capture the Reference Machine

這個群組包含必要的步驟來準備和擷取參照電腦。This group contains the necessary steps to prepare and capture a reference computer.

工作順序步驟Task sequence step 說明Description
準備 Configuration Manager 用戶端Prepare Configuration Manager Client 將參照電腦上的 Configuration Manager 用戶端一般化。Generalize the Configuration Manager client on the reference computer.
準備 OSPrepare OS 執行 Sysprep 以將 Windows 一般化。Runs Sysprep to generalize Windows. 然後 Sysprep 會讓電腦在重新開機時進入為工作順序指定的 Windows PE 開機映像。It then restarts the computer into the Windows PE boot image specified for the task sequence.
擷取參照機器Capture the Reference Machine 將映像擷取至指定的網路共用和 .WIM 檔案。Captures the image to the specified network share and .WIM file.

重要

從參照電腦擷取映像後,請勿從參照電腦擷取另一個 OS 映像。After you capture an image from a reference computer, don't capture another OS image from the reference computer. 登錄項目會在初始設定期間建立。Registry entries are created during the initial configuration. 您每一次擷取 OS 映像,都會建立新的參照電腦。Create a new reference computer each time that you capture the OS image. 如果打算使用相同參照電腦來建立未來的 OS 映像,請先解除安裝並重新安裝 Configuration Manager 用戶端。If you plan to use the same reference computer to create future OS images, first uninstall and reinstall the Configuration Manager client.

後續步驟Next steps

部署企業作業系統的方法Methods to deploy enterprise operating systems