Create a Configuration Manager device collection with a limiting collection for the eligible device scope, then add a WQL query rule that matches the Visual Studio installations you intend to upgrade. Microsoft provides an inventory query example, but its release-year patterns are examples—not a universal upgrade filter. Check the inventory values and collection membership in your own site before deploying.
How to create the device collection
- In the Configuration Manager console, go to Assets and Compliance > Device Collections, then select Create Device Collection.
- Enter a clear collection name and comment. Choose a limiting collection that represents the deployment boundary: the new collection can include only devices within that limiting collection. See Microsoft’s collection creation guidance.
- Add a Query Rule for membership and configure its WQL query. Query rules evaluate on a schedule and update collection membership dynamically. Microsoft’s query membership rule documentation describes the rule and its PowerShell interface.
- Complete the wizard, allow membership evaluation to run, and inspect the resulting members before targeting an upgrade deployment.
Start with Visual Studio software inventory
Microsoft’s Visual Studio instance-detection guidance includes a Configuration Manager software-inventory example that returns computer name, Visual Studio program display name, and version. Its sample joins SMS_R_System, SMS_G_System_COMPUTER_SYSTEM, and SMS_G_System_ADD_REMOVE_PROGRAMS:
As an Amazon Associate I earn from qualifying purchases.
select distinct SMS_G_System_COMPUTER_SYSTEM.Name,
SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName,
SMS_G_System_ADD_REMOVE_PROGRAMS.Version
from SMS_R_System
inner join SMS_G_System_COMPUTER_SYSTEM
on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId
inner join SMS_G_System_ADD_REMOVE_PROGRAMS
on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId
where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "Visual Studio %[a-z]% 201[7,9]"
or SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "Visual Studio %[a-z]% 2026"
The query is an inventory/reporting example, not a drop-in collection rule for every environment. For collection membership, retain the relevant inventory join and matching predicates, and use the device resource fields appropriate to the collection query. Validate the WQL in your site. The example’s 2017, 2019, and 2026 patterns do not establish which release, edition, or channel belongs in your upgrade cohort.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsTarget the intended upgrade cohort
Adjust the display-name predicate to match the Visual Studio release you are upgrading from, and confirm the actual display-name and version values reported by your clients first. The upgrade destination and your site’s inventory values are environment-specific; a broad year or name match can include the wrong installations or miss the intended ones.
#1 Best Overall
- Confirm software inventory is enabled and populated for the clients in scope.
- Review the observed display names and versions before settling on a predicate.
- Keep the limiting collection aligned with the intended deployment boundary; the query rule only selects matching inventoried devices inside that scope.
- Review collection membership before deploying, because membership determines which devices can receive software targeted to the collection.
Troubleshoot computers missing from the collection
- Check the limiting collection: A device outside that collection cannot become a member of the new collection through its query rule.
- Check inventory: If the client has not reported the relevant software data, the query has no matching record to evaluate. Verify inventory is enabled and that the Visual Studio entry appears in the inventory data.
- Check the predicate: Compare the query’s display-name and version conditions with the values actually reported. Product naming or installed release may not match an assumed year pattern.
- Check evaluation timing: Query rules update on a schedule, so membership may not reflect a recent inventory change immediately.
- Validate before deployment: Inspect the returned devices and software values, then confirm the final collection members are the intended targets.
Use local detection for a single device
For fleet targeting, Configuration Manager software inventory lets you query client devices centrally. For local troubleshooting or identifying instances on an individual machine, Microsoft’s Visual Studio guidance also names vswhere and VSSetup.PowerShell. These serve different scopes; the cited guidance does not claim that one method is universally preferable.
Be careful when changing membership rules
An include membership rule can add devices as another collection changes. Microsoft warns that software or configuration deployments targeting the resulting collection can then apply to newly included devices. Treat changes to membership on a deployment-target collection as deployment-scope changes, and review the resulting members. See Microsoft’s include membership rule documentation.
Quick Recap
Rank #4
Rank #2
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Recommended Free Tools




