Forum Discussion
Prashant Sharma
Dec 30, 2019Brass Contributor
How to Put the OMS agent into the Multiple VMs using Powershell and CSV.
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.
- hspinto
Microsoft
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:
- If VM runs in Azure, add the Log Analytics extension to the VM (instructions for Windows VMs + different parameters for Linux VMs)
- If VMs run outside of Azure, you can download the installer and call it from the command line inside the VM (Windows / Linux).