Connect Batch of Azure VMs to Log Analytics (OMS) via PowerShell

So, you have a bunch of Virtual Machines (VMs) in Azure, and didn’t used an ARM template, and now need to connect the VMs to Log Analytics (OMS). Earlier this month, I demonstrated on this can be done with the ARM portal, here’s that blog post. Of course, this has to be done individually and can be very tedious if you have 10’s or 100’s of machines to do this to… All I can think of is PowerShell!

Here is a script I tweaked that Microsoft has already provided but for a single VM. I have just tweaked it to automate and traverse through your entire resource group, and add ALL VMs within the RG to Log Analytics.

For the complete post, please visit, SCOMandOtherGeekyStuff.com.

One thought on “Connect Batch of Azure VMs to Log Analytics (OMS) via PowerShell

  1. Pingback: Connect Batch of Azure VMs to Log Analytics (OMS) via PowerShell – System Center Central – Cloud & Virtualization Complete Guide

Leave a Reply