使用商務用 Windows Update 部署服務來部署加速更新
在本文中,您將:
必要條件
必須符合商務 Windows Update 部署服務的所有必要條件,包括確保用戶端上已安裝更新健全狀況工具。
- 更新健全狀況工具會從KB4023057開始安裝。 若要確認裝置上是否有更新健全狀況工具,請使用下列其中一種方法:
- 執行 加速更新的整備測試
- 尋找 C:\Program Files\Microsoft Update Health Tools 資料夾,或檢閱新增 Microsoft Update Health Tools 的移除程式。
- 驗證工具安裝的範例 PowerShell 文稿:
Get-CimInstance -ClassName Win32_Product \| Where-Object {$_.Name -match "Microsoft Update Health Tools"}
權限
本文所列的查詢需要下列許可權:
某些角色,例如 Windows Update 部署系統管理員,已經擁有這些許可權。
開啟圖形總管
在本文中,您將使用 Graph 總管向 Microsoft Graph API 提出要求,以擷取、新增、刪除和更新數據。 Graph 總管是開發人員工具,可讓您瞭解 Microsoft Graph API。 如需使用 Graph 總管的詳細資訊,請 參閱開始使用 Graph 總管。
警告
從瀏覽器,移至 [Graph 總管],然後使用 Microsoft Entra 用戶帳戶登入。
您可能需要啟
WindowsUpdates.ReadWrite.All
用許可權,才能使用本文中的查詢。 若要啟用權限:若要提出要求:
- 從 HTTP 方法的下拉式清單中選取 GET、POST、PUT、PATCH 或 DELETE。
- 在 [URL] 欄位中輸入要求。 版本會根據 URL 自動填入。
- 如果您需要修改要求本文,請編輯 [ 要求本文] 索引標籤。
- 選取 [ 執行查詢] 按鈕。 結果會出現在 [ 回應 ] 視窗中。
提示
檢閱 Microsoft Graph 檔時,您可能會注意到範例要求通常會列出
content-type: application/json
。content-type
Graph 總管通常不需要指定 ,但您可以選取 [標頭] 索引標籤,並將 新content-type
增至 [要求標頭] 字段做為 [索引鍵] 和application/json
[值],將它新增至要求。
執行查詢以識別裝置
使用 裝置 資源類型來尋找要註冊到部署服務的用戶端。 變更查詢參數以符合您的特定需求。 如需詳細資訊,請 參閱使用查詢參數。
顯示 所有裝置的 AzureAD 裝置識別碼 和 名稱 :
GET https://graph.microsoft.com/v1.0/devices?$select=deviceid,displayName
顯示名稱開頭
Test
為 之裝置的 AzureAD 裝置識別碼和名稱:GET https://graph.microsoft.com/v1.0/devices?$filter=startswith(displayName,'Test')&$select=deviceid,displayName
新增進階查詢的要求標頭
針對下一個要求,將 ConsistencyLevel 標頭設定為 eventual
。 如需進階查詢參數的詳細資訊,請參閱 Microsoft Entra 目錄對象的進階查詢功能。
在 [圖形總管] 中,選取 [ 要求標頭] 索引卷 標。
針對 中的索引
ConsistencyLevel
鍵類型,以及 Value 的 索引鍵類型,輸入eventual
。選取 [ 新增] 按鈕。 當您完成時,請選取垃圾桶圖示來移除要求標頭。
顯示具有 作為 AzureAD 裝置識別碼之裝置
01234567-89ab-cdef-0123-456789abcdef
的名稱和作業系統版本:GET https://graph.microsoft.com/v1.0/devices?$search="deviceid:01234567-89ab-cdef-0123-456789abcdef"&$select=displayName,operatingSystemVersion
若要尋找可能不是虛擬機的裝置,請篩選未將虛擬機列為模型但已列出製造商的裝置。 顯示每個 裝置的 AzureAD 裝置識別碼、 名稱和 作業系統版本 :
GET https://graph.microsoft.com/v1.0/devices?$filter=model ne 'virtual machine' and NOT(manufacturer eq null)&$count=true&$select=deviceid,displayName,operatingSystemVersion
提示
使用 裝置 資源類型的要求通常同時 id
具有 和 deviceid
:
deviceid
是 Microsoft Entra 裝置識別碼,將在本文中使用。- 在本文稍後,
deviceid
當您提出某些要求,例如將裝置新增至部署物件時,這會作為id
。
- 在本文稍後,
- 來自
id
裝置資源類型的 通常是 Microsoft Entra 物件標識符,本文不會使用此標識符。
列出加速更新的目錄專案
每個更新都會與唯一 的目錄項目相關聯。 您可以查詢目錄以尋找可加速的更新。 傳 id
回的 是 目錄標識碼 ,用來建立部署。 下列查詢會列出部署服務可部署為加速更新的所有安全性和非安全性 品質更新。 使用 $top=2
和排序 方式 ReleaseDateTimeshows
會顯示可以加速方式部署的最新更新。
GET https://graph.microsoft.com/beta/admin/windows/updates/catalog/entries?$filter=isof('microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry') and microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/isExpeditable eq true&$orderby=releaseDateTime desc&$top=2
下列截斷的回應會顯示安全性更新的e317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5
08/08/2023 - 2023.08 B SecurityUpdate for Windows 10 and later
目錄識別碼:
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#admin/windows/updates/catalog/entries",
"value": [
{
"@odata.type": "#microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry",
"id": "e317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5",
"displayName": "08/08/2023 - 2023.08 B SecurityUpdate for Windows 10 and later",
"deployableUntilDateTime": null,
"releaseDateTime": "2023-08-08T00:00:00Z",
"isExpeditable": true,
"qualityUpdateClassification": "security",
"catalogName": "2023-08 Cumulative Update for Windows 10 and later",
"shortName": "2023.08 B",
"qualityUpdateCadence": "monthly",
"cveSeverityInformation": {
"maxSeverity": "critical",
"maxBaseScore": 9.8,
"exploitedCves@odata.context": "https://graph.microsoft.com/$metadata#admin/windows/updates/catalog/entries('e317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5')/microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/cveSeverityInformation/exploitedCves",
"exploitedCves": [
{
"number": "ADV230003",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/ADV230003"
},
{
"number": "CVE-2023-38180",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2023-38180"
}
]
}
}
]
}
部署服務可以顯示 2023 年 1 月或之後發行的更新詳細資訊。 使用 產品修訂 可提供更新的其他資訊,例如 KB 編號和 MajorVersion.MinorVersion.BuildNumber.UpdateBuildRevision
。 Windows 10 和11共用相同的主要和次要版本,但組建編號不同。
使用下列命令來顯示最新品質更新的產品修訂資訊:
GET https://graph.microsoft.com/beta/admin/windows/updates/catalog/entries?$expand=microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/productRevisions&$orderby=releaseDateTime desc&$top=1
下列截斷的回應會顯示 Windows 10 版本 22H2 和 Windows 11 版本 22H2 KB5029263的KB5029244相關信息:
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#admin/windows/updates/catalog/entries(microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/productRevisions())",
"value": [
{
"@odata.type": "#microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry",
"id": "e317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5",
"displayName": "08/08/2023 - 2023.08 B SecurityUpdate for Windows 10 and later",
"deployableUntilDateTime": null,
"releaseDateTime": "2023-08-08T00:00:00Z",
"isExpeditable": true,
"qualityUpdateClassification": "security",
"catalogName": "2023-08 Cumulative Update for Windows 10 and later",
"shortName": "2023.08 B",
"qualityUpdateCadence": "monthly",
"cveSeverityInformation": {
"maxSeverity": "critical",
"maxBaseScore": 9.8,
"exploitedCves@odata.context": "https://graph.microsoft.com/beta/$metadata#admin/windows/updates/catalog/entries('e317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5')/microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/cveSeverityInformation/exploitedCves",
"exploitedCves": [
{
"number": "ADV230003",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/ADV230003"
},
{
"number": "CVE-2023-38180",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2023-38180"
}
]
},
"productRevisions@odata.context": "https://graph.microsoft.com/beta/$metadata#admin/windows/updates/catalog/entries('e317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5')/microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/productRevisions",
"productRevisions": [
{
"id": "10.0.19045.3324",
"displayName": "Windows 10, version 22H2, build 19045.3324",
"releaseDateTime": "2023-08-08T00:00:00Z",
"version": "22H2",
"product": "Windows 10",
"osBuild": {
"majorVersion": 10,
"minorVersion": 0,
"buildNumber": 19045,
"updateBuildRevision": 3324
},
"knowledgeBaseArticle@odata.context": "https://graph.microsoft.com/beta/$metadata#admin/windows/updates/catalog/entries('e317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5')/microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/productRevisions('10.0.19045.3324')/knowledgeBaseArticle/$entity",
"knowledgeBaseArticle": {
"id": "KB5029244",
"url": "https://support.microsoft.com/help/5029244"
}
},
{
"id": "10.0.22621.2134",
"displayName": "Windows 11, version 22H2, build 22621.2134",
"releaseDateTime": "2023-08-08T00:00:00Z",
"version": "22H2",
"product": "Windows 11",
"osBuild": {
"majorVersion": 10,
"minorVersion": 0,
"buildNumber": 22621,
"updateBuildRevision": 2134
},
"knowledgeBaseArticle@odata.context": "https://graph.microsoft.com/beta/$metadata#admin/windows/updates/catalog/entries('e317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5')/microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry/productRevisions('10.0.22621.2134')/knowledgeBaseArticle/$entity",
"knowledgeBaseArticle": {
"id": "KB5029263",
"url": "https://support.microsoft.com/help/5029263"
}
},
建立部署
建立部署時,有 多個選項 可用來定義部署的行為。 下列範例會使用目錄專案標識碼 建立08/08/2023 - 2023.08 B SecurityUpdate for Windows 10 and later
安全性更新的部署,並在要求本文中定義 expedite
和 userExperience
部署e317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5
選項。
POST https://graph.microsoft.com/beta/admin/windows/updates/deployments
content-type: application/json
{
"@odata.type": "#microsoft.graph.windowsUpdates.deployment",
"content": {
"@odata.type": "#microsoft.graph.windowsUpdates.catalogContent",
"catalogEntry": {
"@odata.type": "#microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry",
"id": "e317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5"
}
},
"settings": {
"@odata.type": "microsoft.graph.windowsUpdates.deploymentSettings",
"expedite": {
"isExpedited": true
},
"userExperience": {
"daysUntilForcedReboot": 2
}
}
}
要求會針對新建立的部署,傳回 201 建立的回應碼和回應本文中的 部署 物件,其中包括:
- 新建立之部署的部署 標識
de910e12-3456-7890-abcd-ef1234567890
碼。 - 新建立之部署對象的物件 標識
d39ad1ce-0123-4567-89ab-cdef01234567
碼。
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#admin/windows/updates/deployments/$entity",
"id": "de910e12-3456-7890-abcd-ef1234567890",
"createdDateTime": "2024-01-30T19:43:37.1672634Z",
"lastModifiedDateTime": "2024-01-30T19:43:37.1672644Z",
"state": {
"effectiveValue": "offering",
"requestedValue": "none",
"reasons": []
},
"content": {
"@odata.type": "#microsoft.graph.windowsUpdates.catalogContent",
"catalogEntry@odata.context": "https://graph.microsoft.com/beta/$metadata#admin/windows/updates/deployments('073fb534-5cdd-4326-8aa2-a4d29037b60f')/content/microsoft.graph.windowsUpdates.catalogContent/catalogEntry/$entity",
"catalogEntry": {
"@odata.type": "#microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry",
"id": "e317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5",
"displayName": null,
"deployableUntilDateTime": null,
"releaseDateTime": "2023-08-08T00:00:00Z",
"isExpeditable": false,
"qualityUpdateClassification": "security",
"catalogName": null,
"shortName": null,
"qualityUpdateCadence": "monthly",
"cveSeverityInformation": null
}
},
"settings": {
"schedule": null,
"monitoring": null,
"contentApplicability": null,
"userExperience": {
"daysUntilForcedReboot": 2,
"offerAsOptional": null
},
"expedite": {
"isExpedited": true,
"isReadinessTest": false
}
},
"audience@odata.context": "https://graph.microsoft.com/beta/$metadata#admin/windows/updates/deployments('de910e12-3456-7890-abcd-ef1234567890')/audience/$entity",
"audience": {
"id": "d39ad1ce-0123-4567-89ab-cdef01234567",
"applicableContent": []
}
}
將成員新增至部署物件
對象識別碼d39ad1ce-0123-4567-89ab-cdef01234567
是在建立部署時建立的。 物件 標識碼 是用來將成員新增至部署物件。 更新部署對象之後,Windows Update 會根據部署設定開始為裝置提供更新。 只要部署存在且裝置位於物件中,就會加速更新。
下列範例會使用每個裝置的 Microsoft Entra ID,將兩個裝置新增至部署物件:
POST https://graph.microsoft.com/beta/admin/windows/updates/deploymentAudiences/d39ad1ce-0123-4567-89ab-cdef01234567/updateAudience
content-type: application/json
{
"addMembers": [
{
"@odata.type": "#microsoft.graph.windowsUpdates.azureADDevice",
"id": "01234567-89ab-cdef-0123-456789abcdef"
},
{
"@odata.type": "#microsoft.graph.windowsUpdates.azureADDevice",
"id": "01234567-89ab-cdef-0123-456789abcde0"
}
]
}
若要確認裝置已新增至物件,請使用 的d39ad1ce-0123-4567-89ab-cdef01234567
物件識別碼執行下列查詢:
GET https://graph.microsoft.com/beta/admin/windows/updates/deploymentAudiences/d39ad1ce-0123-4567-89ab-cdef01234567/members
刪除部署
若要停止加速部署,請刪除部署。 如果裝置尚未收到內容,刪除部署將會防止將內容提供給裝置。 若要繼續提供內容,必須建立新的核准。
下列範例會刪除 部署標識碼 為 的 de910e12-3456-7890-abcd-ef1234567890
部署:
DELETE https://graph.microsoft.com/beta/admin/windows/updates/deployments/de910e12-3456-7890-abcd-ef1234567890
加速更新的整備測試
您可以使用 isReadinessTest 來確認用戶端是否準備好接收加速更新。 建立指定為加速整備測試的部署,然後將成員新增至部署物件。 服務會檢查用戶端是否符合加速更新的必要條件。 測試結果會顯示在 Windows Update for Business 報表活頁簿中。 在 [ 品質更新] 索引標籤下 ,選取 [ 加速狀態 ] 圖格,這會開啟具有 整備 程度測試結果之 [整備程度] 索引卷標的飛出視窗。
POST https://graph.microsoft.com/beta/admin/windows/updates/deployments
content-type: application/json
{
"@odata.type": "#microsoft.graph.windowsUpdates.deployment",
"content": {
"@odata.type": "#microsoft.graph.windowsUpdates.catalogContent",
"catalogEntry": {
"@odata.type": "#microsoft.graph.windowsUpdates.qualityUpdateCatalogEntry",
"id": "317aa8a0455ca604de95329b524ec921ca57f2e6ed3ff88aac757a7468998a5"
}
},
"settings": {
"@odata.type": "microsoft.graph.windowsUpdates.deploymentSettings",
"expedite": {
"isExpedited": true,
"isReadinessTest": true
}
}
}
截斷的回應會顯示 isReadinessTest 設定為 true
,並提供的 DeploymentID。de910e12-3456-7890-abcd-ef1234567890
然後,您可以將成員新增至部署物件,讓服務檢查裝置是否符合必要條件,然後在商務用 Windows Update 報表活頁簿中檢閱結果。
"expedite": {
"isExpedited": true,
"isReadinessTest": true
}
},
"audience@odata.context": "https://graph.microsoft.com/beta/$metadata#admin/windows/updates/deployments('6a6c03b5-008e-4b4d-8acd-48144208f179_Readiness')/audience/$entity",
"audience": {
"id": "de910e12-3456-7890-abcd-ef1234567890",
"applicableContent": []
}
更新健全狀況工具的記錄位置
當您部署加速更新時,會使用更新健全狀況工具。 在某些情況下,您可能想要檢閱更新健全狀況工具的記錄。
記錄檔位置: %ProgramFiles%\Microsoft Update Health Tools\Logs
- 記錄檔格式
.etl
為 。- Microsoft 在 GitHub 上提供 PerfView 作為下載專案,以顯示
.etl
檔案。
- Microsoft 在 GitHub 上提供 PerfView 作為下載專案,以顯示
如需詳細資訊,請參閱 針對加速更新進行疑難解答。
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應