List installed RAM for each computer
SQL query for the Configuration Manager database that lists the installed memory in GB for each computer, with a filter for low memory.
LanguageSQL
What it does to the systemReads only. It changes nothing.
Memory decides if a computer can run a new Windows version or a heavy application. This query shows the memory of every computer.
The result shows each computer and its memory in GB. The computer with the least memory is at the top.
SQL
-- 0 = show all computers. 8 = show only computers with less than 8 GB.
DECLARE @LessThanGB INT = 0;
SELECT
rs.Name0 AS ComputerName,
CAST(mem.TotalPhysicalMemory0 / 1024.0 / 1024.0 AS DECIMAL(10,1)) AS MemoryGB
FROM v_R_System rs
JOIN v_GS_X86_PC_MEMORY mem
ON mem.ResourceID = rs.ResourceID
WHERE @LessThanGB = 0
OR mem.TotalPhysicalMemory0 < CAST(@LessThanGB AS BIGINT) * 1024 * 1024
ORDER BY mem.TotalPhysicalMemory0, rs.Name0;
How to use it
- Open SQL Server Management Studio and connect to the site database.
- Paste the query into a new query window.
- Run the query to list every computer.
- Change
@LessThanGBto show only computers under that amount.
Good to know
v_GS_X86_PC_MEMORYstores TotalPhysicalMemory0 in KB. The view covers 64-bit computers too, in spite of its name.- The number is the memory Windows can use. It is a little under the size of the installed modules, so 8 GB shows as about 7.9.
- The data comes from hardware inventory.
RAM
memory
v_GS_X86_PC_MEMORY
v_R_System
More SCCM SQL queries
Check BitLocker protection status for each computer
Count Configuration Manager client versions in your environment
Find computers that have not rebooted in 14 days
Find computers with low free space on the C: drive
Find computers with no hardware inventory in 30 days
Find duplicate computer names and duplicate serial numbers