SCCM – SQL Query for all server CPU information

SQL CPU Information

If you are looking for an SQL query to use against your System Center Configuration Manager database to give you the ability to report on server CPU information, this is the query for you!

You can use the below to get various information on the CPU or you can use SELECT * to bring back all information and make your own choices. We have gone for the basics of what you would normally need for a report using SSRS or Power BI.

SELECT
   DISTINCT(CPU.SystemName0) AS [System Name],
   CS.Manufacturer0 AS [Make],
   CS.Model0 AS [Model],
   OS.Caption0 AS [Operating System],
   CS.SystemType0 AS [Architecture],
   CPU.Name0 AS [CPU Model],
   COUNT(CPU.ResourceID) AS [Number of CPUs],
   CPU.NumberOfCores0 AS [Number of Cores per CPU],
   CPU.NumberOfLogicalProcessors0 AS [Logical CPU Count]
FROM [dbo].[v_GS_PROCESSOR] CPU
   LEFT OUTER JOIN dbo.v_GS_COMPUTER_SYSTEM CS
ON CS.ResourceID = CPU.ResourceID
   LEFT OUTER JOIN dbo.v_GS_Operating_System OS
ON CS.ResourceID = OS.ResourceID
   WHERE OS.Caption0 LIKE '%server%'
GROUP BY
   CS.Manufacturer0,
   CS.Model0,
   OS.Caption0,
   CS.SystemType0,
   CPU.SystemName0,
   CPU.Name0,
   CPU.NumberOfCores0,
   CPU.NumberOfLogicalProcessors0
ORDER BY [System Name] ASC

This should then produce SQL information like this:

You can then use this to create pretty reports in SSRS or Power BI!

More Queries

Our full range of SQL and WQL Collection queries are available here.

Feedback

If you have any questions or feedback about this post, or if you would like us to create any queries for you, please go ahead and leave us a message below in the comments section and we will get back to you as quick as we can.


You might also like...

Leave us a message...

This site uses Akismet to reduce spam. Learn how your comment data is processed.