What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Create a Configuration Manager device collection by choosing a limiting collection for the eligible device scope, then adding a WQL query membership rule that matches the installed Visual Studio version or release you want to upgrade. Validate the resulting membership before deploying: the query only finds devices whose software inventory contains matching data.

How the collection targets upgrade candidates

The limiting collection sets the outer boundary: the new device collection can contain only devices in that scope. A query membership rule then selects the devices within that boundary whose inventoried software matches your Visual Studio criteria. Query rules use WQL and update membership on a schedule, so membership can change as inventory and device data change.

Configuration Manager software inventory is one documented way to identify Visual Studio instances across client devices. Microsoft also names vswhere and VSSetup.PowerShell as tools for detecting instances on an individual machine. Centralized inventory is suited to fleet-level targeting when the relevant data is collected; local detection tools can help investigate a particular computer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create the device collection

  1. In the Configuration Manager console, go to Assets and Compliance > Device Collections, then select Create Device Collection.
  2. Enter a clear collection name and comment.
  3. Select a limiting collection that reflects the deployment boundary you intend to enforce. The new collection cannot draw members from outside it.
  4. Add a Query Rule for membership. Configure the WQL query for the installed Visual Studio cohort you want to target.
  5. Review the collection’s membership results before using it as an upgrade deployment target.

Use Visual Studio inventory to find installed releases

Microsoft’s Visual Studio instance-detection guidance includes this Configuration Manager inventory query. It returns the computer name, program display name, and version for matching installed Visual Studio entries. Its year patterns are examples, not a universal recommendation for upgrade targeting.

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"

For collection membership, adapt the example to the device resource fields and software-inventory joins needed by the collection, along with predicates for the intended upgrade cohort. The published query is an inventory example that selects descriptive fields; validate the WQL in your site before relying on it for membership.

Match the query to the upgrade cohort

First inspect the display names and versions that your site actually reports. Then adjust the query predicate for the release, edition, channel, or version that defines the devices eligible for this upgrade. The example’s year literals do not establish which release your organization should target, and the appropriate predicate depends on the upgrade destination and your inventory values.

  • Confirm software inventory is enabled and populated for the relevant clients.
  • Check actual inventory values rather than assuming display names follow the example exactly.
  • Test the adapted WQL and inspect the returned devices before deployment.

The assignment does not specify a destination Visual Studio release or a site’s inventory values, so there is no single correct release predicate to apply to every environment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Diagnose computers missing from the collection

  • Outside the limiting collection: A device cannot appear in the new collection if it is not in the selected limiting scope.
  • Inventory absent or stale: Query membership depends on inventoried software data. Check whether software inventory is enabled and whether the client has reported the relevant entry.
  • Predicate does not match: Compare the device’s reported display name and version with the query conditions. Adjust the predicate to the observed value and intended cohort.
  • Membership has not refreshed: Query rules update on a schedule. Allow for the configured evaluation cycle, then check the collection results again.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check membership before deployment

A collection’s membership determines which devices may receive software targeted to it. Confirm the resulting list is the intended upgrade cohort before deployment. Be especially careful with include membership rules: Microsoft notes that when another collection changes, newly included devices can become subject to software or configuration deployments targeted at the resulting collection.

Microsoft documentation: Tools for detecting and managing Visual Studio instances, Create collections in Configuration Manager, Add-CMDeviceCollectionQueryMembershipRule, and Add-CMDeviceCollectionIncludeMembershipRule.

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.