Forum Discussion
awood86
Jul 01, 2020Copper Contributor
Custom Query for finding VMs without software installed
Hi, I was hoping someone maybe able to help me. Within Log Analytics I can query for VMs with certain software installed. But I need to query where the VMs haven't got a certain software install...
Noa Kuperberg
Microsoft
Jul 01, 2020Hi awood86 ,
There are different ways to go about it, one way is to create a set of all installed software items (within a given time range) and check if a value is in that set.
Note that if it's not in the set, it only means it wasn't installed in that time range, but it's still possible it's been installed earlier... so think well what's the time range you want to use.
ConfigurationData
| where TimeGenerated > ago(3d)
| where ConfigDataType == "Software"
| summarize all_sotftware_installed = make_set(SoftwareName) by Computer
| where set_has_element(all_sotftware_installed, "Microsoft 365 - en-us") == 0 // 0 means it's not in the set, 1 means it is
HTH,
Noa