How to become a DIMM-wit!

By Jesse Hamrick • June 17th, 2008

PowerShell DIMM Sockets

I was going through the mail-bag the other day and noticed the same question kept popping up. "How do I know how much memory is in my system?" I thought to myself, that question is too easy to answer and the PowerShell solution has to be available on at least a few thousand websites. But, in my haste to get through the mail the actual question was not sinking into my thick skull…

I was reading "How much memory" not "How much memory is installed in my system and how many DIMM slots do I have available?" Great question! Wouldn't it be nice to run a PowerShell Script that would give you the amount of RAM installed and the available slots in the system. How many of you still shut the server down, open the box, and inventory the DIMM count? Well those days are over…

Here is a simple script that will Inventory the total number of physical memory slots, the slots populated, and the size of each DIMM installed:

$strComputer = Read-Host "Enter Computer Name"
$colSlots = Get-WmiObject -Class "win32_PhysicalMemoryArray" -namespace "root\CIMV2" `
-computerName $strComputer
$colRAM = Get-WmiObject -Class "win32_PhysicalMemory" -namespace "root\CIMV2" `
-computerName $strComputer

Foreach ($objSlot In $colSlots){
    "Total Number of DIMM Slots: " + $objSlot.MemoryDevices
}
Foreach ($objRAM In $colRAM) {
    "Memory Installed: " + $objRAM.DeviceLocator
    "Memory Size: " + ($objRAM.Capacity / 1GB) + " GB"
}

Use this simple little script to check under the hood without actually shutting down the server to open the hood.

-Enjoy

Email This Post To A Friend Email This Post To A Friend 

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • Furl
  • Reddit
  • Technorati
  • YahooMyWeb
 

Leave a Comment

« New Tutorial - Managing Active Directory with Windows PowerShell | Home | Want a Free PowerShell Editor? No, Really it’s Free… »