Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check memory remotely 1

Status
Not open for further replies.

oned

MIS
Feb 8, 2005
70
US
Does anyone know of a way to find out how much memory a computer has that is in a wan?
I would like to query machines to see total memory and if possible number of simms installed.
 
mmc.exe and use a remote computer management snap-in.. as long as you have rights to that computer you should be able to remotely look at the stats/ config..
 
Which snap-in? There is no remote computer management snap-in. Can't find memory under computer management.
 
If you have administrator rights on the remote PC and the PC is running Windows 2000 or later (or Windows Script Host) you can use the following script:

Code:
On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("PCNAME1","PCNAME2","PCNAME3")
For Each strComputer In arrComputers

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PhysicalMemory", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)
   intTotalMemory = 0
   For Each objItem In colItems
      intTotalMemory = intTotalMemory + objItem.Capacity
   Next
   intTotalMegabytes = intTotalMemory / 1048576
   WScript.Echo "Computer: " & strComputer & "   " & "Total Memory: " & intTotalMegabytes & " MB"
Next

Just copy and paste it into notepad, replace "PCNAME1", etc with the actual PC names, save it as something with .VBS extension, then run it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top