Get a list of all VMs in a subscription that do not have this feature enabled? Enable Monitoring Insights?
There are only below options to install VM Insights
, refer the MS DOC for more details.
Here is a PowerShell script to enable VM
Insights features on all VMs
that are not already enabled in the subscription
.
Install-Script -Name Install-VMInsights
$DcrResourceId = "DCR_Resource-ID"
$uamrgname = "User assigned managed identity rg name"
$uamname ="User assigned managed identity name"
$subid= "<SUB-ID>"
$vmnames = Get-AzVM
Foreach($vms in $vmnames){
Write-Host : "Enabling VM Insight feature on VM name: $($vms.Name)"
Install-VMInsights.ps1 -SubscriptionId $subid -ResourceGroup $vms.ResourceGroupName -Name $vms.Name -DcrResourceId $DcrResourceId -UserAssignedManagedIdentityName $uamrgname -UserAssignedManagedIdentityResourceGroup $uamname
}
Output:
After running the script, the VM
Insights feature has been enabled on the VMs
Reference: Enable VM insights by using PowerShell
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4