Azure Arc Servers Failing Updates from Update Management

mwhite 0 Reputation points
2023-06-05T20:20:28.41+00:00

We have two Windows Servers that are both 2019 that are enrolled in Azure Arc and they keep failing Windows Updates from Azure Update Management. We have like 50 other servers in our environment and all are working fine except for two of them. A lot of our other servers are also 2019. We are getting the below error on both of these servers and have had no luck resolving:

Exception: 'The term 'Get-AutomationVariable' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.'. 

Has any one out there experienced this error and have some things for us to try? We already tried re-enrolling the servers in Azure Arc and no luck. We also made sure the Microsoft Monitoring Agent on both servers was correct by following these steps:

  1. Open control panel on the machine and search for "Microsoft Monitoring Agent"
  2. Click on "Microsoft Monitoring Agent" to open it --> switch to "Azure Log Analytics (OMS)" tab. Check if you have the correct entry for workspace in there with green check suggesting that the machine is connected to workspace.

Any help is much appreciated.

Thanks!

Azure Arc
Azure Arc
A Microsoft cloud service that enables deployment of Azure services across hybrid and multicloud environments.
320 questions
Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,113 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AnuragSingh-MSFT 19,691 Reputation points
    2023-06-07T08:25:47.4+00:00

    @mwhite , Thank you for posting this question in Microsoft Q&A.

    Based on the error mentioned (Exception: 'The term 'Get-AutomationVariable'), it seems that these 2 machines are no longer connected/recognized as hybrid worker for the Azure Automation account. After you enable Update Management, any Windows machine that's directly connected to your Log Analytics workspace is automatically configured as a system Hybrid Runbook Worker to support the runbooks that support Update Management. For more details, see Update Management Hybrid Worker groups.

    You can verify if this machine is added to Azure Automation Hybrid worker group by following the path below:

    1. Azure Automation --> Hybrid worker groups
    2. Select "System hybrid worker groups" tabs
    3. select the group names --> "Hybrid worker". There may be multiple groups available, try to check if the impacted machines are listed in there.

    I would suggest using the "Offline troubleshooter script" available here to get details of the configuration on the machine and if something is missing. For more details, see Update Management: Troubleshoot WIndows update agent issues. Pay attention to the "CheckResult" property for each test and if you see something not with "Passed" status, it could point to the actual issue. Most commonly, the issue is related to broken network connectivity.

    You should also check the "OperationsManager" logs in the EventViewer for the errors being reported. Based on the error/warning in there, further troubleshooting steps can be taken but the output from script above and the events in event log will serve as the starting points.

    Hope this helps.

    If the answer did not help, please add more context/follow-up question for it, and we will help you out. Else, if the answer helped, please click Accept answer so that it can help others in the community looking for help on similar topics.