Skip to content
ConfigMgr CMPivot Favorite Query | SCCM  SQL Query to Find out Saved | vSMS_CMPivotFavorite

ConfigMgr CMPivot Favorite Query | SCCM SQL Query to Find out Saved | vSMS_CMPivotFavorite

Written By Anoop C Nair
Last Updated August 20, 2024
Posted In SCCM
SHARE

Let’s discuss ConfigMgr CMPivot Favorite Query | SCCM SQL Query to Find out Saved | vSMS_CMPivotFavorite. I accidentally found the ConfigMgr CMPivot favourite query option to save your favourite queries.

I thought it would be helpful to share it here so you don’t have to save the CMPivot queries in OneNote or some other place. CMPivot’s favourite option is useful when downloading the CMPivot query published in Community Hub.

CMPivot allows you to evaluate the state of devices in your environment faster and act. When you enter a query, CMPivot will run it in real-time on all presently connected devices in the selected collection.

In the following post, ConfigMgr CMPivot Query to Find Clients not Part of Any Boundary Groups | SCCM, I explained how to download and start using the CMPivot query from the Community Hub. However, I was confused about where to find the downloaded CMPivot query.

Patch My PC

How to Save ConfigMgr CMPivot Favorite Query?

It’s interesting to know that downloading the CMPivot query from Community Hub will automatically add it as a CMPivot favorite query. Let’s see where this favorite query icon is in CMPivot.

  • Launch the CMPivot tool from the console or standalone tool.
  • Click on the icon on the right-side corner of the CMPivot tool.
  • The following screenshot shows a list of queries. Some downloaded this query from Community Hub, and others were manually saved.
ConfigMgr CMPivot Favorite Query | SCCM  SQL Query to find out Saved | vSMS_CMPivotFavorite - Fig.1
ConfigMgr CMPivot Favorite Query | SCCM SQL Query to find out Saved | vSMS_CMPivotFavorite – Fig.1

I have downloaded another query from Community Hub published by MVP colleague Panu Saukko.

ConfigMgr CMPivot Favorite Query | SCCM  SQL Query to find out Saved | vSMS_CMPivotFavorite - Fig.2
ConfigMgr CMPivot Favorite Query | SCCM SQL Query to find out Saved | vSMS_CMPivotFavorite – Fig.2

I have closed and reopened the CMPivot tool.

  • Click on the CMPivot Favorite query icon.
  • The Windows Cumulative Update CMPivot query is available under the Favorite query.
// Shows the pie chart of Windows 10/2016/2019 cumulative update versions
OperatingSystem 
| project Device, BuildNumber
| join (Registry('HKLM:\\Software\\Microsoft\\Windows NT\\CurrentVersion')
| where Property =='UBR' | project Device, CU=Value)
| project Device, FullBuild=strcat(BuildNumber,'.',tostring(CU))
| summarize count() by FullBuild
| render piechart with(title='Windows CUs')
ConfigMgr CMPivot Favorite Query | SCCM  SQL Query to find out Saved | vSMS_CMPivotFavorite - Fig.3
ConfigMgr CMPivot Favorite Query | SCCM SQL Query to find out Saved | vSMS_CMPivotFavorite – Fig.3

vSMS_CMPivotFavorite

The SQL view vSMS_CMPivotFavorite gets you the details of all the admins’ CMPivot favorite queries. So, you might see some interesting data from this view. Be careful if you want to keep your query a secret, even though I don’t recommend keeping it.

You can run the following SQL query from SQL Management Studio to determine which SCCM admins’ favourite CMPivot queries are in your environment.

Select * from vSMS_CMPivotFavorite
ConfigMgr CMPivot Favorite Query | SCCM  SQL Query to find out Saved | vSMS_CMPivotFavorite - Fig.4
ConfigMgr CMPivot Favorite Query | SCCM SQL Query to find out Saved | vSMS_CMPivotFavorite – Fig.4

The following table gives more information about CMPivot favorite query view.

Script GuidUser NameNameQuery
7DC6B6F1-E7F6-43C1-96E0-E1D16BC25C14MEMCM\anoopShows when devices have restarted in the last seven daysOperatingSystem | where LastBootUpTime <= ago(7d) | summarize count() by bin(LastBootUpTime,1d) | render timechart
7DC6B6F1-E7F6-43C1-96E0-E1D16BC25C14MEMCM\anoopClients without BoundaryCcmLog(‘LocationServices’) | where LogText contains ‘Client is not in any boundary group.’ | project Device, LogText, DateTime
7DC6B6F1-E7F6-43C1-96E0-E1D16BC25C14MEMCM\anoopLogical Disk per Device ChartLogicalDisk | summarize sum( FreeSpace ) by Device | order by sum_ desc | render column chart
ConfigMgr CMPivot Favorite Query | SCCM SQL Query to find out Saved | vSMS_CMPivotFavorite – Table.1

Resources

We are on WhatsApp now. To get the latest step-by-step guides, news, and updates, Join our Channel. Click here – HTMD WhatsApp.

Author

Anoop C Nair has been Microsoft MVP from 2015 onwards for 10 consecutive years! He is a Workplace Solution Architect with more than 22+ years of experience in Workplace technologies. He is also a Blogger, Speaker, and Local User Group Community leader. His primary focus is on Device Management technologies like SCCM and Intune. He writes about technologies like Intune, SCCM, Windows, Cloud PC, Windows, Entra, Microsoft Security, Career, etc.

Written by

Anoop C Nair is Workplace Technology solution architect with 25+ years of experience in global enterprise organizations such as JP Morgan, Capgemini, etc. Microsoft Certified Trainer. Microsoft MVP from 2015 onwards for consecutive 11+ years! He also conducts Intune and modern workplace tech training for enterprise organizations. He is Blogger, Speaker, and Founder of HTMD Community and HTMD Conference. His main focus is on Device Management technologies like Intune, Windows, Cloud PC. He writes about technologies like Intune, SCCM, Windows, Cloud PC, Windows, Entra, Microsoft Security.

Discussion · 2 comments

  1. Do you know if it’s possible to add favorite queries to all users’ CMPivot favorites? I can see the favorites I’ve made, but other users don’t see my favorites. I think that would be a great feature to provide favorites to the helpdesk for example.

  2. This is really great information Anoop! Thank you for sharing all of the useful and timely information that you do.

Join the discussion

Your email address will not be published. Required fields are marked *

Related guides

Intune

Windows 11 KB5101650 KB5099414 July 2026 Patch and 3 Zero Day Vulnerabilities and 570 Flaws

Key Takeaways Windows 11 KB5101650 KB5099414 July 2026 Patch and 3 Zero Day Vulnerabilities and 570 Flaws! In the July 2026 Patch, Microsoft introduced new features designed to improve the overall Windows experience. The update adds enhancements to Windows Update for more flexible update management and introduces Point-in-Time Restore, providing an additional recovery option for […]

AC Anoop C Nair 9 min read
Intune

2026 June KB5094126 KB5093998 Windows 11 Patch | 3 Zero Day Vulnerabilities and 200 Flaws

Key Takeaways 2026 June KB5094126 KB5093998 Windows 11 Patch | 3 Zero Day Vulnerabilities and 200 Flaws! The June 2026 Windows 11 Patch Tuesday update brings several improvements to File Explorer. It adds support for additional archive formats, including UU, CPIO, XAR, and NuGet Packages (NUPKG). The update also preserves View and Sort preferences in […]

AC Anoop C Nair 10 min read
Intune

2026 May KB5089549 KB5087420 Windows 11 Patch | 0 Zero Day Vulnerabilities and 120 Flaws

Key Takeaways The Windows 11 May 2026 Patch KB5089549 KB5087420 Update brings important security fixes, performance improvements, and reliability enhancements across the operating system. The update introduces new features such as Xbox Mode for gaming, File Explorer improvements, enhanced input and sharing experiences, better taskbar and Windows Hello reliability, and additional enterprise management capabilities for […]

AC Anoop C Nair 8 min read
SCCM

ConfigMgr 2603 Introduces New Early Update Enrollment Process

Key Takeaways In this post we are discussing the ConfigMgr 2603 Introduces New Early Update Enrollment Process. Microsoft has officially released Configuration Manager version 2603 to the Early Update Ring, giving organizations an opportunity to test upcoming improvements before the global production rollout. The release is targeted at enterprises running ConfigMgr version 2409 or later […]

AC Anoop C Nair 3 min read