Azure automation runbook to remove OMS agent to disable monitoring

Azure automation runbook to remove OMS agent to disable monitoring

This script/runbook can help you to remove OMs agent from any of VM and stop monitoring for that particular VM instance.

Refer MS gallery for full script – https://gallery.technet.microsoft.com/Disable-OMSMonitoring-8e1f5f4d

Once you have the code downloaded from above link then just create new runbook inside azure automation account and copy that code to runbook as it is and start runbook . Once you click on start the runbook will prompt you for few details like workspace name, vm name, resource group name and then it will remove vm from OMS.

Prerequisites

  • The runbooks work with an Azure Run As account. The Run As account is the preferred authentication method since it uses certificate authentication instead of a password that may expire or change frequently.
  • This solution can only manage VMs that are in the same subscription as where the Automation account resides. but if in case you want to manage vm from another subscription then that is possible , you just need to add another subscription connect asset and have to add code to connect another subscription before get-azurermvm commands
  • This solution must need OMS installed in subscription
  • you must Need AzureRM.OperationalInsights module in azure automation account to perform this operation.

Refer MS gallery for full script – https://gallery.technet.microsoft.com/Disable-OMSMonitoring-8e1f5f4d

 

(Visited 1,241 times, 1 visits today)
One Comment

Add a Comment

Facebook