Unable to Update the Network Watcher extension to the latest version

JMC 21 Reputation points
2021-01-19T20:47:28.73+00:00

I received an email from Microsoft indicating that I had to update our Network Watcher extension on our VM to the latest version by this past Friday. However, I am getting an error when I attempt this.

Instruction Link: https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/network-watcher-update#update-your-extension-manually

When I follow the instructions for Option 1 (using PowerShell) and run the following line on our Azure VM (a web server):

Set-AzVMExtension -ResourceGroupName "MyResourceGroupName" -Location "East US 2" -VMName "MyVMName" -Name "AzureNetworkWatcherExtension" -Publisher "Microsoft.Azure.NetworkWatcher" -Type "NetworkWatcherAgentWindows" -ForceRerun "True"

I get the following error:
The term 'Set-AzVMExtension' is not recognized as the name of a cmdlet, function, script file, or operable program.

Does anyone know what is causing this error?

Thanks,
JMC

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,576 questions
{count} votes

Accepted answer
  1. SUNOJ KUMAR YELURU 14,711 Reputation points MVP
    2021-01-20T01:14:09.553+00:00

    Hi @JMC

    Thank You for posting in Q & A.

    To resolve this issue, follow these steps.

    Install the Azure Active Directory Module for Windows PowerShell on the computer (if it isn't already installed). To install the Azure Active Directory Module for Windows PowerShell, see Manage Azure AD using Windows PowerShell.

    Select Start > All Programs, select Windows Azure Active Directory, and then select Windows Azure Active Directory Module for Windows PowerShell.

    At the Windows PowerShell command prompt, type Get-Module, and then press Enter.

    In the output, check that the Az.Compute module is present. The output should look similar to the following one:

    If the Az.Compute module isn't present, use Windows PowerShell to import the Az.Compute module. To do it, follow these steps:

    Connect to Exchange Online by using remote PowerShell. For more info about how to do it, see Connect to Exchange Online Using Remote PowerShell.

    Type the following cmdlet, and then press Enter:

    Import-Module Az.Compute

    Please don’t forget to Accept the answer and up-vote wherever the information provided helps you, this can be beneficial to other community members.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.