Installing Azure Monitor Log Analytics Agents with Powershell

After my previous article about the wonders of the new Azure Update Management Extension for SCVMM 2019, some of you might have been thinking that it was all well and good that VMM now automates the installation and configuration of the Azure Monitor Log Analytics Agent (MMA) for you when deploying new VMs, but what about all those existing servers out there?

Well unfortunately out of the box, Microsoft doesn’t provide a single installer UI that can target multiple machines, unless you’ve also got SCOM deployed and have configured it’s OMS integration as well.

Nevertheless, Powershell is to the rescue! With a little bit of Googling, I was able to find a rather nice script created by John Savill, but it too was limited to being run interactively on a single machine at a time.

So I decided to take things into my own hands and craft a Powershell function that can target as many servers as I want, with some added flexibility as to whether I want to download a fresh installed or use an existing copy saved on a share.

The resulting script is a little lengthy to read over, but it does the trick!

I will continue to maintain the function in my Github repo, however this initial cut should get others going!
Hopefully this helps you accelerate your adoption of some of the great Azure Hybrid scenarios available today.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.