共用方式為


針對 Windows 更新代理程式問題進行疑難排解

電腦在更新管理部署期間未顯示為就緒 (狀況良好),可能有很多原因。 您可檢查 Windows 混合式 Runbook 背景工作角色代理程式的健康狀態以判斷根本問題。 下列是電腦的三種整備狀態:

  • 準備就緒:混合式 Runbook 背景工作角色已部署,上次出現時間為不到一小時前。
  • 已中斷連線:混合式 Runbook 背景工作角色已部署,上次出現時間為超過一小時前。
  • 未設定:找不到混合式 Runbook 背景工作角色或尚未完成部署。

注意

Azure 入口網站顯示的內容與機器目前的狀態間,可能略有延遲。

本文探討如何以 Azure 入口網站與非 Azure 機器在離線情況下執行 Azure 機器的疑難排解員。

注意

疑難排解指令碼現在包含 Windows Server Update Services (WSUS) 和自動下載並安裝金鑰的檢查。

啟動疑難排解員

針對 Azure 機器,您可選取 [更新代理程式整備程度] 資料行下的 [疑難排解] 連結,即可啟動 [對更新代理程式進行疑難排解] 頁面。 針對非 Azure 機器,此連結會連往本文。 若要對非 Azure 機器進行疑難排解,請參閱離線疑難排解

Screenshot of the Update Management list of virtual machines.

注意

若要檢查混合式 Runbook 背景工作角色的健康狀態,則必須執行 VM。 如果 VM 未執行,將會出現 [啟動 VM] 按鈕。

在 [對更新代理程式進行疑難排解] 頁面上,選取 [執行檢查] 以啟動疑難排解員。 疑難排解員會使用執行命令在機器上執行指令碼,以驗證相依性。 疑難排解員完成後,會傳回檢查結果。

Screenshot of the Troubleshoot Update Agent page.

結果準備就緒時就會顯示在頁面上。 檢查區段會顯示每項檢查所包含的項目。

Screenshot of Windows Troubleshooter.

先決條件檢查

作業系統

作業系統檢查會確認混合式 Runbook 背景工作角色是否正在執行支援的作業系統之一

.NET 4.6.2

.NET Framework 檢查會驗證系統已安裝 .NET Framework 4.6.2 或更新版本。

若要修正,請安裝 .NET Framework 4.6 或更新版本。
下載 .NET Framework

WMF 5.1

WMF 檢查會確認系統具有所需版本的 Windows Management Framework (WMF)。

若要修正,您必須下載並安裝 Windows Management Framework 5.1,因為 Azure 更新管理需要 Windows PowerShell 5.1 才能運作。

TLS 1.2

此檢查會判斷您是否使用 TLS 1.2 來加密通訊。 此平台已不再支援 TLS 1.0。 使用 TLS 1.2 與更新管理進行通訊。

若要修正,請按照步驟啟用 TLS 1.2

監視代理程式服務健康情況檢查

Hybrid Runbook Worker

若要修正此問題,請強制重新註冊混合式 Runbook 背景工作角色。

Remove-Item -Path "HKLM:\software\microsoft\hybridrunbookworker" -Recurse -Force 
Restart-service healthservice

注意

這會從機器中移除使用者混合式背景工作角色。 之後務必檢查並重新註冊。 如果機器只有系統混合式 Runbook 背景工作角色,則不需要採取任何動作。

若要驗證,請檢查 Microsoft-SMA/Operational 事件記錄檔中「有」事件識別碼「15003 (HW 開始事件) 或 15004 (hw 已停止事件)」。

如果問題仍未修正,請提交支援票證。

VM 的連結工作區

請參閱網路需求 (機器翻譯)。

若要驗證:請檢查 VM 已連線工作區或對應記錄分析的活動訊號表格。

Heartbeat | where Computer =~ ""

Windows 更新服務狀態

若要修正此問題,請啟動 wuaserv 服務。

Start-Service -Name wuauserv -ErrorAction SilentlyContinue

連線能力檢查

疑難排解員目前不會透過 Proxy 伺服器 (如果已設定) 來路由傳送流量。

註冊端點

此檢查會判斷代理程式是否能夠正確地與代理程式服務進行通訊。

Proxy 和防火牆設定必須允許「混合式 Runbook 背景工作角色」代理程式與註冊端點進行通訊。 如需打算開啟的位址與連接埠清單,請參閱網路規劃

允許必要 URL。 網路變更之後,您可以重新執行疑難排解員,或執行下列命令來驗證:

$workspaceId =- ""  
$endpoint = $workspaceId + “.agentsvc.azure-automation.net”  
(Test-NetConnection -ComputerName $endpoint -Port 443 -WarningAction SilentlyContinue).TcpTestSucceeded 

作業端點

此檢查會判斷代理程式是否能夠正確地與「作業執行階段資料服務」進行通訊。

Proxy 和防火牆設定必須允許「混合式 Runbook 背景工作角色」代理程式與「作業執行階段資料服務」進行通訊。 如需打算開啟的位址與連接埠清單,請參閱網路規劃

允許必要 URL。 網路變更之後,您可以重新執行疑難排解員,或執行下列命令來驗證:

$jrdsEndpointLocationMoniker = “” 

# $jrdsEndpointLocationMoniker should be based on automation account location (jpe/ase/scus) etc.  

$endpoint = $jrdsEndpointLocationMoniker + “-jobruntimedata-prod-su1.azure-automation.net” 

(Test-NetConnection -ComputerName $endpoint -Port 443 -WarningAction SilentlyContinue).TcpTestSucceeded  

HTTPS 連線

簡化持續管理網路安全性規則。 允許必要 URL

網路變更之後,您可以重新執行疑難排解員,或執行下列命令來驗證:

$uri = "https://eus2-jobruntimedata-prod-su1.azure-automation.net"
Invoke-WebRequest -URI $uri -UseBasicParsing

Proxy 設定

如果已啟用 Proxy,請確定您可以存取必要 URL

若要檢查 Proxy 是否已正確設定,請使用下列命令:

netsh winhttp show proxy

或檢查在以下項目中登錄機碼 ProxyEnable 設定為 1

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings

IMDS 端點連線能力

若要修正此問題,請允許存取 IP 169.254.169.254
如需詳細資訊,請參閱存取 Azure Instance Metadata Service (機器翻譯)

網路變更之後,您可以重新執行疑難排解員,或執行下列命令來驗證:

Invoke-RestMethod -Headers @{"Metadata"="true"} -Method GET -Uri http://169.254.169.254/metadata/instance?api-version=2018-02-01

VM 服務健康情況檢查

監視代理程式服務狀態

此檢查會判斷適用於 Windows 的 Log Analytics 代理程式 (healthservice) 是否正在電腦上執行。 若要深入了解如何對此服務進行疑難排解,請參閱適用於 Windows 的 Log Analytics 代理程式未執行

若要重新安裝適用於 Windows 的 Log Analytics 代理程式,請參閱安裝適用於 Windows 的代理程式

監視代理程式服務事件

此檢查會判斷在機器上的 Azure Operations Manager 記錄中,在過去 24 小時內是否有任何 4502 事件。

若要深入了解此事件,請參閱此事件 Operations Manager 記錄中的 4502 事件

存取權限檢查

機器金鑰資料夾

此檢查會判斷本機系統帳戶是否能夠存取:C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys

若要修正,請在 C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys 資料夾上,將必要權限 (讀取、寫入和修改或完全控制) 授與 SYSTEM 帳戶

使用下列命令來檢查資料夾上的權限:


$folder = “C:\\ProgramData\\Microsoft\\Crypto\\RSA\\MachineKeys” 

(Get-Acl $folder).Access |? {($_.IdentityReference -match $User) -or ($_.IdentityReference -match "Everyone")} | Select IdentityReference, FileSystemRights

機器更新設定

安裝後自動重新開機

若要修正,請從以下位置移除登錄機碼:HKLM:\Software\Policies\Microsoft\Windows\WindowsUpdate\AU

根據更新管理排程設定,設定重新開機。

AlwaysAutoRebootAtScheduledTime 
AlwaysAutoRebootAtScheduledTimeMinutes

如需詳細資訊,請參閱設定重新開機設定 (機器翻譯)

WSUS 伺服器設定

如果環境設定為從 WSUS 取得更新,請確定在更新部署之前已在 WSUS 中核准。 如需詳細資訊,請參閱 WSUS 組態設定 (機器翻譯)。 如果您的環境未使用 WSUS,請確定您移除 WSUS 伺服器設定,並重設 Windows Update 元件 (機器翻譯)。

自動下載並安裝

若要修正此問題,請停用 AutoUpdate 功能。 在本機群組原則 [設定自動更新] 中,將其設定為 [停用]。 如需詳細資訊,請參閱設定自動更新 (機器翻譯)。

離線疑難排解

您可以藉由在本機執行指令碼,對「混合式 Runbook 背景工作角色」使用疑難排解員。 從 GitHub 取得下列指令碼:UM_Windows_Troubleshooter_Offline.ps1。 若要執行此指令碼,您必須安裝 WMF 5.0 或更新版本。 若要下載最新版的 PowerShell,請參閱安裝各種版本的 PowerShell

此指令碼的輸出會如下列範例所示:

RuleId                      : OperatingSystemCheck 
RuleGroupId                 : prerequisites 
RuleName                    : Operating System 
RuleGroupName               : Prerequisite Checks 
RuleDescription             : The Windows Operating system must be version 6.1.7600 (Windows Server 2008 R2) or higher 
CheckResult                 : Passed 
CheckResultMessage          : Operating System version is supported 
CheckResultMessageId        : OperatingSystemCheck.Passed 
CheckResultMessageArguments : {} 

 

RuleId                      : DotNetFrameworkInstalledCheck 
RuleGroupId                 : prerequisites 
RuleName                    : .NET Framework 4.6.2+
RuleGroupName               : Prerequisite Checks 
RuleDescription             : .NET Framework version 4.6.2 or higher is required 
CheckResult                 : Passed 
CheckResultMessage          : .NET Framework version 4.6.2+ is found 
CheckResultMessageId        : DotNetFrameworkInstalledCheck.Passed 
CheckResultMessageArguments : {} 

 

RuleId                      : WindowsManagementFrameworkInstalledCheck 
RuleGroupId                 : prerequisites 
RuleName                    : WMF 5.1 
RuleGroupName               : Prerequisite Checks 
RuleDescription             : Windows Management Framework version 4.0 or higher is required (version 5.1 or higher is preferable) 
CheckResult                 : Passed 
CheckResultMessage          : Detected Windows Management Framework version: 5.1.22621.169 
CheckResultMessageId        : WindowsManagementFrameworkInstalledCheck.Passed 
CheckResultMessageArguments : {5.1.22621.169} 

 

RuleId                      : AutomationAgentServiceConnectivityCheck1 
RuleGroupId                 : connectivity 
RuleName                    : Registration endpoint 
RuleGroupName               : connectivity 
RuleDescription             :  
CheckResult                 : Failed 
CheckResultMessage          : Unable to find Workspace registration information 
CheckResultMessageId        : AutomationAgentServiceConnectivityCheck1.Failed.NoRegistrationFound 
CheckResultMessageArguments :  

 

RuleId                      : AutomationJobRuntimeDataServiceConnectivityCheck 
RuleGroupId                 : connectivity 
RuleName                    : Operations endpoint 
RuleGroupName               : connectivity 
RuleDescription             : Proxy and firewall configuration must allow Automation Hybrid Worker agent to communicate with  
                              eus2-jobruntimedata-prod-su1.azure-automation.net 
CheckResult                 : Passed 
CheckResultMessage          : TCP Test for eus2-jobruntimedata-prod-su1.azure-automation.net (port 443) succeeded 
CheckResultMessageId        : AutomationJobRuntimeDataServiceConnectivityCheck.Passed 
CheckResultMessageArguments : {eus2-jobruntimedata-prod-su1.azure-automation.net} 

 

RuleId                      : MonitoringAgentServiceRunningCheck 
RuleGroupId                 : servicehealth 
RuleName                    : Monitoring Agent service status 
RuleGroupName               : VM Service Health Checks 
RuleDescription             : HealthService must be running on the machine 
CheckResult                 : Passed 
CheckResultMessage          : Microsoft Monitoring Agent service (HealthService) is running 
CheckResultMessageId        : MonitoringAgentServiceRunningCheck.Passed 
CheckResultMessageArguments : {Microsoft Monitoring Agent, HealthService} 

 

RuleId                      : SystemHybridRunbookWorkerRunningCheck 
RuleGroupId                 : servicehealth 
RuleName                    : Hybrid runbook worker status 
RuleGroupName               : VM Service Health Checks 
RuleDescription             : Hybrid runbook worker must be in running state. 
CheckResult                 : Passed 
CheckResultMessage          : Hybrid runbook worker is running. 
CheckResultMessageId        : SystemHybridRunbookWorkerRunningCheck.Passed 
CheckResultMessageArguments : {} 

 

RuleId                      : MonitoringAgentServiceEventsCheck 
RuleGroupId                 : servicehealth 
RuleName                    : Monitoring Agent service events 
RuleGroupName               : VM Service Health Checks 
RuleDescription             : Event Log must not have event 4502 logged in the past 24 hours 
CheckResult                 : Passed 
CheckResultMessage          : Microsoft Monitoring Agent service Event Log (Operations Manager) does not have event 4502 logged in the last 24 hours. 
CheckResultMessageId        : MonitoringAgentServiceEventsCheck.Passed 
CheckResultMessageArguments : {Microsoft Monitoring Agent, Operations Manager, 4502} 

 

RuleId                      : LinkedWorkspaceCheck 
RuleGroupId                 : servicehealth 
RuleName                    : VM's Linked Workspace 
RuleGroupName               : VM Service Health Checks 
RuleDescription             : Get linked workspace info of the VM 
CheckResult                 : Failed 
CheckResultMessage          : VM is not reporting to any workspace. 
CheckResultMessageId        : LinkedWorkspaceCheck.Failed.NoWorkspace 
CheckResultMessageArguments : {} 

 
RuleId                      : CryptoRsaMachineKeysFolderAccessCheck 
RuleGroupId                 : permissions 
RuleName                    : Crypto RSA MachineKeys Folder Access 
RuleGroupName               : Access Permission Checks 
RuleDescription             : SYSTEM account must have WRITE and MODIFY access to 'C:\\ProgramData\\Microsoft\\Crypto\\RSA\\MachineKeys' 
CheckResult                 : Passed 
CheckResultMessage          : Have permissions to access C:\\ProgramData\\Microsoft\\Crypto\\RSA\\MachineKeys 
CheckResultMessageId        : CryptoRsaMachineKeysFolderAccessCheck.Passed 
CheckResultMessageArguments : {C:\\ProgramData\\Microsoft\\Crypto\\RSA\\MachineKeys} 


RuleId                      : TlsVersionCheck 
RuleGroupId                 : prerequisites 
RuleName                    : TLS 1.2 
RuleGroupName               : Prerequisite Checks 
RuleDescription             : Client and Server connections must support TLS 1.2 
CheckResult                 : Passed 
CheckResultMessage          : TLS 1.2 is enabled by default on the Operating System. 
CheckResultMessageId        : TlsVersionCheck.Passed.EnabledByDefault 
CheckResultMessageArguments : {} 

 
RuleId                      : AlwaysAutoRebootCheck 
RuleGroupId                 : machineSettings 
RuleName                    : AutoReboot 
RuleGroupName               : Machine Override Checks 
RuleDescription             : Automatic reboot should not be enable as it forces a reboot irrespective of update configuration 
CheckResult                 : Passed 
CheckResultMessage          : Windows Update reboot registry keys are not set to automatically reboot 
CheckResultMessageId        : AlwaysAutoRebootCheck.Passed 
CheckResultMessageArguments :  

 

RuleId                      : WSUSServerConfigured 
RuleGroupId                 : machineSettings 
RuleName                    : isWSUSServerConfigured 
RuleGroupName               : Machine Override Checks 
RuleDescription             : Increase awareness on WSUS configured on the server 
CheckResult                 : Passed 
CheckResultMessage          : Windows Updates are downloading from the default Windows Update location. Ensure the server has access to the Windows Update service 
CheckResultMessageId        : WSUSServerConfigured.Passed 
CheckResultMessageArguments :  

 

RuleId                      : AutomaticUpdateCheck 
RuleGroupId                 : machineSettings 
RuleName                    : AutoUpdate 
RuleGroupName               : Machine Override Checks 
RuleDescription             : AutoUpdate should not be enabled on the machine 
CheckResult                 : Passed 
CheckResultMessage          : Windows Update is not set to automatically install updates as they become available 
CheckResultMessageId        : AutomaticUpdateCheck.Passed 
CheckResultMessageArguments :  

 

RuleId                      : HttpsConnection 
RuleGroupId                 : connectivity 
RuleName                    : Https connection 
RuleGroupName               : connectivity 
RuleDescription             : Check if VM is able to make https requests. 
CheckResult                 : Passed 
CheckResultMessage          : VM is able to make https requests. 
CheckResultMessageId        : HttpsConnection.Passed 
CheckResultMessageArguments : {} 

 

RuleId                      : ProxySettings 
RuleGroupId                 : connectivity 
RuleName                    : Proxy settings 
RuleGroupName               : connectivity 
RuleDescription             : Check if Proxy is enabled on the VM. 
CheckResult                 : Passed 
CheckResultMessage          : Proxy is not set. 
CheckResultMessageId        : ProxySettings.Passed 
CheckResultMessageArguments : {} 

 
RuleId                      : IMDSConnectivity 
RuleGroupId                 : connectivity 
RuleName                    : IMDS endpoint connectivity 
RuleGroupName               : connectivity 
RuleDescription             : Check if VM is able to reach IMDS server to get VM information. 
CheckResult                 : PassedWithWarning 
CheckResultMessage          : VM is not able to reach IMDS server. Consider this as a Failure if this is an Azure VM. 
CheckResultMessageId        : IMDSConnectivity.PassedWithWarning 
CheckResultMessageArguments : {} 

 

RuleId                      : WUServiceRunningCheck 
RuleGroupId                 : servicehealth 
RuleName                    : WU service status 
RuleGroupName               : WU Service Health Check 
RuleDescription             : WU must not be in the disabled state. 
CheckResult                 : Passed 
CheckResultMessage          : Windows Update service (wuauserv) is running. 
CheckResultMessageId        : WUServiceRunningCheck.Passed 
CheckResultMessageArguments : {Windows Update, wuauserv} 

 
RuleId                      : LAOdsEndpointConnectivity 
RuleGroupId                 : connectivity 
RuleName                    : LA ODS endpoint 
RuleGroupName               : connectivity 
RuleDescription             : Proxy and firewall configuration must allow to communicate with LA ODS endpoint 
CheckResult                 : Failed 
CheckResultMessage          : Unable to find Workspace registration information 
CheckResultMessageId        : LAOdsEndpointConnectivity.Failed 
CheckResultMessageArguments :  

 
RuleId                      : LAOmsEndpointConnectivity 
RuleGroupId                 : connectivity 
RuleName                    : LA OMS endpoint 
RuleGroupName               : connectivity 
RuleDescription             : Proxy and firewall configuration must allow to communicate with LA OMS endpoint 
CheckResult                 : Failed 
CheckResultMessage          : Unable to find Workspace registration information 
CheckResultMessageId        : LAOmsEndpointConnectivity.Failed 
CheckResultMessageArguments :  

下一步

針對混合式 Runbook 背景工作角色問題進行疑難排解