How to Put the OMS agent into the Multiple VMs using Powershell and CSV.

Brass Contributor

I have the multiple VMs in my space. i want to insert the OMS agent into all the VMs.

How to perform this using powerShell? any script, i can put my VM name and resource group into a csv file and run the script and Agents has been updated in all VMs.

1 Reply

@Prashant Sharma, you have several options to onboard your VMs to Log Analytics. If the VMs are running in Azure, you can onboard them via Azure Portal, Azure Policy (the recommended way, as with the "Deploy Log Analytics agent" policies, every new VM will be automatically onboarded), via ARM templates, or via command line (Powershell/CLI).

 

Answering your specific question, the Powershell approach would be: