You can get information about the RAM installed on your computer through some built-in System Info tools or various 3rd party system inventory utilities such as CPU-Z, or AIDA32. But here I am going to talk about how to use PowerShell, the built-in script tool that comes with Windows, to extract the same info from your local and remote computers.
How many memory slots do I have?
You can simply run the following cmdlet in PowerShell window to find out.
Get-WmiObject -class "Win32_PhysicalMemoryArray"
The MemoryDevices column indicates how many memory slots are available in your computer while MaxCapacity tells you how much total of RAM you can install.
To get the info from a remote computer, use -computername switch to the cmdlet. For example,
Get-WmiObject -class "Win32_PhysicalMemoryArray" -computername C-20141222B
How many memory sticks and total of RAM installed?
The following cmdlet reveals this information in a single run.
Get-WmiObject Win32-PhysicalMemory | Measure-Object -Property Capacity -Sum
And again, adding -computername switch in the end if you want to get the info from a remote computer.
Get-WmiObject Win32-PhysicalMemory -computername C-20141222B | Measure-Object -Property Capacity -Sum
Gathering other memory info
Win32_PhysicalMemory class has tons of properties that you can use to pull from your computer, such as FormFactor, SerialNumber, Speed, etc. You just need to call them up and format them properly. Piping out to Out-GridView is probably the easiest way to get a clean view of what type of RAM you have installed on your computer.
Get-WmiObject Win32-PhysicalMemory -computername C-20141222B | Out-GridView
Putting everything together
And of course, it’s nice if we can put all codes together in a PowerShell format so we can run it easily to get all information at once whether from a local or remote computer. Download the full script below, and run it in a form of:
ram.ps1 -computername remotecomputer
Latest posts by Kent Chen (see all)
- How To Disable Removable USB Storage Read, Write and Execute Access on Windows 10 - December 1, 2016
- Windows 10 Tip: How To Move System Tray to the Second Display - November 30, 2016
- How To Display The Last Logon Account Info on Windows 7 and 10 - November 29, 2016
Last updated: 01/21/2016