Solved

How to remotely find out how many RAM slots a machines has?

Posted on 2008-06-12
8
11,462 Views
Last Modified: 2013-11-10
I have a bunch of remote machines I need to find out how many RAM slots they have and if they are used or not. It's for systems upgrade. So for example if I have a machine with 512RAM (I can find that info remotely via XP System  Information) how would I know if it uses 2x256 or a single 512 stick? And if it has another free slot for another 512RAM stick

Thank you!
0
Comment
Question by:piotrmikula108
  • 4
  • 3
8 Comments
 
LVL 77

Expert Comment

by:Rob Williams
ID: 21771659
I don't know how you can find out how many slots are in use, but you can find out the # of slots and RAM requirements by getting the motherboard make and model from System Info and then looking up the motherboard on the manufacturers web site.
0
 
LVL 24

Accepted Solution

by:
purplepomegranite earned 500 total points
ID: 21771704
The attached code returns RAM information.

To use this remotely, just change the strComputer variable to the name of the computer you want to check.

It returns detailed information of the installed memory, and also the number of slots in the system.
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory")
For Each objItem in colItems
Wscript.Echo "Bank Label: " & objItem.BankLabel
Wscript.Echo "Capacity: " & objItem.Capacity / 1048576
Wscript.Echo "Data Width: " & objItem.DataWidth
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Device Locator: " & objItem.DeviceLocator
Wscript.Echo "Form Factor: " & objItem.FormFactor
Wscript.Echo "Hot Swappable: " & objItem.HotSwappable
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Memory Type: " & objItem.MemoryType
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Part Number: " & objItem.PartNumber
Wscript.Echo "Position In Row: " & objItem.PositionInRow
Wscript.Echo "Speed: " & objItem.Speed
Wscript.Echo "Tag: " & objItem.Tag
Wscript.Echo "Type Detail: " & objItem.TypeDetail
Wscript.Echo "-------------------------"
Next
 
 
dim bankCount
Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
 
strWQL = "select * from Win32_MemoryDevice"
Set objInstances = objWMI.ExecQuery(strWQL,,48)
 
bankCount=0
For Each objInstance in objInstances
  bankCount=bankCount+1
Next
wscript.echo bankCount & " memory slots in this machine."

Open in new window

0
 
LVL 1

Author Comment

by:piotrmikula108
ID: 21771942
the script is nice, however after running couple tests it didn't detect a 4 slot mobo, CPUZ shows 4 banks (see picture) and the script shows 2 slots (see attached output) do you know why is that?

thanks a lot
C:\>cscript ramfinder.vbs
Microsoft (R) Windows Script Host Ve
Copyright (C) Microsoft Corporation
 
Bank Label:
Capacity: 1024
Data Width: 64
Description: Physical Memory
Device Locator: DIMM_1
Form Factor: 8
Hot Swappable:
Manufacturer: 7F7F9E0000000000
Memory Type: 20
Name: Physical Memory
Part Number: VS1GB533D2
Position In Row: 1
Speed: 533
Tag: Physical Memory 0
Type Detail: 128
-------------------------
Bank Label:
Capacity: 1024
Data Width: 64
Description: Physical Memory
Device Locator: DIMM_3
Form Factor: 8
Hot Swappable:
Manufacturer: FFFFFFFFFFFFFFFF
Memory Type: 20
Name: Physical Memory
Part Number:
Position In Row: 1
Speed: 533
Tag: Physical Memory 1
Type Detail: 128
-------------------------
2 memory slots in this machine.

Open in new window

Untitled.jpg
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:piotrmikula108
ID: 21771972
sorry here's the correct script output, the RAM amount doesn't match (it was for another machine)


Bank Label:
Capacity: 512
Data Width: 64
Description: Physical Memory
Device Locator: CHANNEL A DIMM 0
Form Factor: 8
Hot Swappable:
Manufacturer:
Memory Type: 0
Name: Physical Memory
Part Number:
Position In Row: 1
Speed: 533
Tag: Physical Memory 0
Type Detail: 128
-------------------------
Bank Label:
Capacity: 512
Data Width: 64
Description: Physical Memory
Device Locator: CHANNEL B DIMM 0
Form Factor: 8
Hot Swappable:
Manufacturer:
Memory Type: 0
Name: Physical Memory
Part Number:
Position In Row: 1
Speed: 533
Tag: Physical Memory 1
Type Detail: 128
-------------------------
2 memory slots in this machine.

Open in new window

0
 
LVL 24

Expert Comment

by:purplepomegranite
ID: 21772049
The vagaries of WMI, and more importantly what Windows is actually able to read about the hardware.

Try the attached - it queries a different memory property.
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory")
For Each objItem in colItems
Wscript.Echo "Bank Label: " & objItem.BankLabel
Wscript.Echo "Capacity: " & objItem.Capacity / 1048576
Wscript.Echo "Data Width: " & objItem.DataWidth
Wscript.Echo "Description: " & objItem.Description
Wscript.Echo "Device Locator: " & objItem.DeviceLocator
Wscript.Echo "Form Factor: " & objItem.FormFactor
Wscript.Echo "Hot Swappable: " & objItem.HotSwappable
Wscript.Echo "Manufacturer: " & objItem.Manufacturer
Wscript.Echo "Memory Type: " & objItem.MemoryType
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "Part Number: " & objItem.PartNumber
Wscript.Echo "Position In Row: " & objItem.PositionInRow
Wscript.Echo "Speed: " & objItem.Speed
Wscript.Echo "Tag: " & objItem.Tag
Wscript.Echo "Type Detail: " & objItem.TypeDetail
Wscript.Echo "-------------------------"
Next
 
 
dim bankCount
Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
 
strWQL = "select * from Win32_SMBIOSMemory"
Set objInstances = objWMI.ExecQuery(strWQL,,48)
 
bankCount=0
For Each objInstance in objInstances
  if objInstance.Description="Memory Device" then bankCount=bankCount+1
Next
wscript.echo bankCount & " memory slots in this machine."

Open in new window

0
 
LVL 1

Author Comment

by:piotrmikula108
ID: 21772264
yeah, there must be something wrong with WMI, now I only get this for that machine with 4 slots

C:\>cscript ramfinder2.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

-------------------------
1 memory slots in this machine.


other machine seem to respond correctly
0
 
LVL 1

Author Comment

by:piotrmikula108
ID: 21772446
I found out I can run that cpuz program to output the info to a text file so I  run

c:\psexec \\remote_machine -c c:\cpuz.exe -txt=filename

and  at the very bottom of the file I get the info:
MI Physical Memory Array
-------------------------
	location	Motherboard
	usage		System Memory
	correction	Single-bit ECC
	max capacity	4096 MBytes
	max# of devices	4
 
 
DMI Memory Device
-----------------
	designation	CHANNEL A DIMM 0
	format		DIMM
	type		SDRAM
	total width	64 bits
	data width	64 bits
	size		256 MBytes
 
 
DMI Memory Device
-----------------
	designation	CHANNEL B DIMM 0
	format		DIMM
	type		SDRAM
	total width	64 bits
	data width	64 bits
	size		256 MBytes
 
 
DMI Memory Device
-----------------
	designation	CHANNEL A DIMM 1
	format		DIMM
	type		SDRAM
	total width	64 bits
	data width	64 bits
 
 
DMI Memory Device
-----------------
	designation	CHANNEL B DIMM 1
	format		DIMM
	type		SDRAM
	total width	64 bits
	data width	64 bits

Open in new window

0
 
LVL 24

Expert Comment

by:purplepomegranite
ID: 21774266
Ah, I think I can see why windows is reporting it as two slots in the first code.  If is dual channel RAM - CPUZ is reporting it as DIMM 0 and DIMM 1, but it is smart enough to work out that there are four slots (channels A and B).

I would imagine that the WMI script works in a large percentage of cases, but there are some when it will fail.  I only tested it on two machines, and on both it was correct.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DHCP restore question Server 2003 to 2012 3 48
How to migrate from 2003 SBS to 2012 R2 as DC? 1 54
Shadow copies windows server 2003 2 86
Sony Laptop Screw 5 38
Scenerio: You have a server running Server 2003 and have applied a retail pack of Terminal Server Licenses.  You want to change servers or your server has crashed and you need to reapply the Terminal Server Licenses. When you enter the 16-digit lic…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now