How to get the total number of assets in the SCCM server using SQL query?

Modified on Mon, 9 Oct, 2023 at 10:19 PM

Please follow the instructions given below: 


  1. Access the database and execute the SQL queries provided below:


  • SELECT COUNT(*) as TotalCount FROM v_GS_SYSTEM;

  • SELECT COUNT(*) as TotalCount FROM v_GS_SYSTEM LEFT JOIN v_GS_WORKSTATION_STATUS ON v_GS_SYSTEM.ResourceID = v_GS_WORKSTATION_STATUS.ResourceID WHERE v_GS_WORKSTATION_STATUS.LastHWScan > CONVERT(DateTime, 'YYYY-MM-DD HH:MM:SS');

  1. The above queries get the total number of devices in SCCM from the Probe.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article