Devices still running Visual Studio 2015 / 2017
Finds devices where Visual Studio 2015 or 2017 (devenv.exe) was actually launched in the last 30 days, with users, install paths, run counts and device group. Separates real usage from installs nobody opens – the evidence you need before removing old versions.
let Lookback = 30d;
DeviceProcessEvents
| where Timestamp > ago(Lookback)
| where FileName =~ "devenv.exe"
| extend VSVersion = case(
ProcessVersionInfoProductVersion startswith "14." or FolderPath contains "Microsoft Visual Studio 14.0", "VS2015",
ProcessVersionInfoProductVersion startswith "15." or FolderPath contains @"Microsoft Visual Studio\2017", "VS2017",
"")
| where isnotempty(VSVersion)
| extend SSDTStandaloneShell = FolderPath contains @"\2017\SQL\" // VS2017 shell installed by standalone SSDT
| summarize FirstRun = min(Timestamp), LastRun = max(Timestamp), Runs = count(),
Users = make_set(AccountName, 20), UPNs = make_set(AccountUpn, 20), Paths = make_set(FolderPath, 5)
by DeviceId, DeviceName, VSVersion, SSDTStandaloneShell
| join kind=leftouter (
DeviceInfo
| where Timestamp > ago(Lookback)
| where isnotempty(MachineGroup)
| summarize arg_max(Timestamp, MachineGroup) by DeviceId
| project DeviceId, DeviceGroup = MachineGroup
) on DeviceId
| project-away DeviceId1
| order by LastRun desc
