Windows Autopilot 使用者導向的 Microsoft Entra 聯結步驟:
- 步驟 1: 設定 Windows Autopilot 設定檔
- 步驟 2:安裝必要的模組,以便從 Intune 取得 Windows Autopilot 設定檔
- 步驟 3: 建立 Windows Autopilot 設定檔的 JSON 檔案
- 步驟 4:在 設定管理員 中建立並散發 JSON 檔案的套件
- 步驟 5:在 設定管理員 中建立 Windows Autopilot 工作順序
- 步驟 6:在 設定管理員 中建立集合
- 步驟 7:將 Windows Autopilot 工作順序部署至 設定管理員 中的集錦
- 步驟 8: 加快部署程序 (選用)
- 步驟 9: 在裝置上執行 Windows Autopilot 任務序列
- 步驟 10: 註冊裝置以加入 Windows Autopilot
如需現有裝置的 Windows Autopilot 部署工作流程概觀,請參閱在 Intune 和 設定管理員 中現有裝置的 Windows Autopilot 部署。
安裝必要模組以從 Intune 取得 Windows Autopilot 設定檔
注意事項
本節中的 PowerShell 程式碼片段已於 2023 年 7 月更新,以使用 Microsoft Graph PowerShell 模組,而不是已過時的 AzureAD Graph PowerShell 模組。 首次使用 Microsoft Graph PowerShell 模組時,可能需要在 Microsoft Entra ID 中核准其他權限。 程式碼片段也已更新,以強制使用更新版本的 WindowsAutoPilot 模組。 如需詳細資訊,請參閱 AzureAD 和重要事項:淘汰 Azure AD Graph 和淘汰 PowerShell 模組。
確定有有效的 Windows Autopilot 設定檔之後,下一個步驟是從 Intune 下載現有的 Windows Autopilot 設定檔作為 JSON 檔案。 JSON 檔案包含有關 Intune 租用戶和 Windows Autopilot 設定檔的所有資訊。 從 Intune 下載 JSON 檔案之後,系統會建立包含 JSON 檔案的 設定管理員 套件。 接著,設定管理員 套件會在現有裝置的 Windows Autopilot 部署工作序列期間,在裝置上安裝 JSON 檔案。
在 設定管理員 工作順序的 WinPE 部分期間,JSON 檔案會安裝在裝置上的離線 Windows 安裝。 JSON 檔案可讓 Windows Autopilot 設定檔 (OOBE) 提供給 Windows 全新體驗,以便在 Windows 初次啟動時執行 Windows Autopilot 部署。 JSON 檔案使 Windows OOBE 不必先從 Intune 下載 Windows Autopilot 設定檔。
注意事項
即使有 JSON 檔案,Windows OOBE 仍然會檢查是否有任何指派給裝置的 Windows Autopilot 設定檔。 如果裝置是 Windows Autopilot 裝置,且已指派至 Windows Autopilot 設定檔,則會從 Intune 下載 Windows Autopilot 設定檔,並改用 JSON 檔案。
從 Intune 下載 Windows Autopilot 設定檔為 JSON 檔案之前,必須先在要下載 Windows Autopilot 設定檔的裝置上安裝特定模組。 從 Intune 取得 Windows Autopilot 設定檔時需要這些模組。 針對本教學課程,為了簡化程式,會在 設定管理員 月臺伺服器上執行這些模組的安裝。 不過,可以使用任何可存取 Intune 的裝置。
若要安裝必要的模組,以 JSON 檔案的形式下載 Windows Autopilot 設定檔,請遵循下列步驟:
登入 設定管理員 站台伺服器或其他可存取 Intune 的裝置。
在裝置上,以系統管理員身分開啟 PowerShell 視窗,方法是以滑鼠右鍵按一下 [開始] 功能表並選取 [Windows PowerShell (管理員) /Windows 終端機 (管理員) ],然後在 [使用者帳戶控制] (UAC) 提示中選取 [是]。
選取下列 PowerShell 程式碼區塊右上角的 [複製],以複製下列命令:
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force Install-Module -Name WindowsAutopilotIntune -MinimumVersion 5.4.0 -Force Install-Module -Name Microsoft.Graph.Groups -Force Install-Module -Name Microsoft.Graph.Authentication -Force Install-Module Microsoft.Graph.Identity.DirectoryManagement -Force Import-Module -Name WindowsAutopilotIntune -MinimumVersion 5.4 Import-Module -Name Microsoft.Graph.Groups Import-Module -Name Microsoft.Graph.Authentication Import-Module -Name Microsoft.Graph.Identity.DirectoryManagement將命令貼到提高權限的 PowerShell 視窗中,然後選取鍵盤上的 Enter 以執行命令。 可能需要再次選取 Enter,才能執行程式碼區塊中的最後一個命令。 成功執行所有命令後,即可安裝所需的模組。
確認可以檢視來自 Intune 的 Windows Autopilot 設定檔
安裝必要的模組之後,可以採取下列步驟來驗證是否可以檢視來自 Intune 的 Windows Autopilot 設定檔:
注意事項
下列步驟不會將 Windows Autopilot 設定檔匯出為 JSON 檔案。 它只會驗證是否可檢視 Windows Autopilot 設定檔。
選取下列 PowerShell 程式碼區塊右上角的 [複製],以複製下列命令:
Connect-MgGraph -Scopes "Device.ReadWrite.All", "DeviceManagementManagedDevices.ReadWrite.All", "DeviceManagementServiceConfig.ReadWrite.All", "Domain.ReadWrite.All", "Group.ReadWrite.All", "GroupMember.ReadWrite.All", "User.Read"將命令貼到提高權限的 PowerShell 視窗中,然後選取鍵盤上的 Enter 以執行命令。
隨即顯示 [ 登入您的帳戶] 視窗。 使用可存取 Intune 和 Windows Autopilot 設定檔的 Microsoft Entra 帳戶登入。
選取下列 PowerShell 程式碼區塊右上角的 [複製],以複製下列命令:
Get-AutopilotProfile | ConvertTo-AutopilotConfigurationJSON將命令貼到提高權限的 PowerShell 視窗中,然後選取鍵盤上的 Enter 以執行命令。
Intune 中所有可用的 Windows Autopilot 設定檔都會以 JSON 格式顯示在 PowerShell 視窗中。 每個個別的 Windows Autopilot 設定檔都封裝在括弧 (
{}) 中。
下一個步驟:為 Windows Autopilot 設定檔建立 JSON 檔案
相關內容
如需安裝必要模組以從 Intune 取得 Windows Autopilot 設定檔的詳細資訊,請參閱下列文章: