Windows Autopilot 使用者導向的 Microsoft Entra 聯結步驟:
- 步驟 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 部署。
建立 Windows Autopilot 設定檔的 JSON 檔案
注意事項
本節中的 PowerShell 程式碼片段已於 2023 年 7 月更新,以使用 Microsoft Graph PowerShell 模組,而不是已過時的 AzureAD Graph PowerShell 模組。 首次使用 Microsoft Graph PowerShell 模組時,可能需要在 Microsoft Entra ID 中核准其他權限。 如需詳細資訊,請參閱 AzureAD 和重要事項:淘汰 Azure AD Graph 和淘汰 PowerShell 模組。
一旦安裝了適當的模組以允許從 Intune 匯出 Windows Autopilot 設定檔,下一個步驟就是將 Windows Autopilot 設定檔匯出為 JSON 檔案。 JSON 檔案可用來在 設定管理員 中建立套件。
若要將 Windows Autopilot 設定檔匯出為 JSON 檔案,請遵循下列步驟:
登入在「安裝必要模組以從 Intune 取得 Windows Autopilot 設定檔」步驟中安裝必要模組的 設定管理員 站台伺服器或其他裝置。
在裝置上,以系統管理員身分開啟 PowerShell 視窗,方法是以滑鼠右鍵按一下 [開始] 功能表並選取 [Windows PowerShell (管理員) /Windows 終端機 (管理員) ],然後在 [使用者帳戶控制] (UAC) 提示中選取 [是]。
選取下列 PowerShell 程式碼區塊右上角的 [複製],以複製下列命令:
Connect-MgGraph -Scopes "Device.ReadWrite.All", "DeviceManagementManagedDevices.ReadWrite.All", "DeviceManagementServiceConfig.ReadWrite.All", "Domain.ReadWrite.All", "Group.ReadWrite.All", "GroupMember.ReadWrite.All", "User.Read" $AutopilotProfile = Get-AutopilotProfile $targetDirectory = "C:\Autopilot" $AutopilotProfile | ForEach-Object { New-Item -ItemType Directory -Path "$targetDirectory\$($_.displayName)" $_ | ConvertTo-AutopilotConfigurationJSON | Set-Content -Encoding Ascii "$targetDirectory\$($_.displayName)\AutopilotConfigurationFile.json" }將命令貼到提高權限的 PowerShell 視窗中,然後選取鍵盤上的 Enter 以執行命令。 如果提高權限的 PowerShell 命令視窗尚未登入 Intune,則會出現 [登入您的帳戶] 視窗。 使用可存取 Intune 和 Windows Autopilot 設定檔的 Microsoft Entra 帳戶登入。
登入 Intune 之後,可能需要再次選取 Enter,才能執行程式碼區塊中的最後一個命令。
一旦所有命令都成功執行,Windows Autopilot 設定檔會出現在變數指定
$targetDirectory資料夾下的子資料夾中。 根據預設,變數為$targetDirectoryC:\AutoPilot,但如果需要,可以將其變更為其他位置。 子資料夾具有來自 Intune 的 Windows Autopilot 設定檔名稱。 如果有多個 Windows Autopilot 設定檔,每個設定檔都有自己的子資料夾。 在每個資料夾中,都有一個名為AutopilotConfigurationFile.json的 JSON 檔案。
注意事項
上述指令碼會從 Intune 匯出所有 Windows Autopilot 設定檔。 除了支援的使用者導向 Windows Autopilot 設定檔之外,如果環境中存在不支援的預先佈建 Windows Autopilot 設定檔和自我部署的 Windows Autopilot 設定檔,它也會下載它們。
下一個步驟:在 設定管理員 中建立並散發 JSON 檔案的套件
相關內容
如需建立 JSON 檔案的詳細資訊,請參閱下列文章: