Last updated: 2023-10-09

Source: https://support.freshservice.com/support/solutions/articles/50000009153-how-to-get-the-total-number-of-assets-in-the-sccm-server-using-sql-query-

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');
  • 2. The above queries get the total number of devices in SCCM from the Probe.