New hardware changes

Hi,

We have just upgraded 300 machines with 512 ram.Previous it was 512.Now it is 1 GB.

Is there a way to check which all machines have been upgraded.

regards
Sharath
LVL 11
bsharathAsked:
Who is Participating?
 
canaliConnect With a Mentor Commented:
finally...

@echo off
:: GetRam.cmd
:: Get ram info  in "alive" computers  found in the list c:\computers.txt
:: and check for updated with double quotes in PC name
:: noDELAYEDEXPANSION
::
::
setlocal
::  set the RAM quantity
::  if Computer ram is > ramsize the pc is already updated

::  ramsize is 512MB
set ramsize=536330240
for /f %%c in ('type c:\computers.txt') do (
  set t=
  (ping -n 2 -w 500 %%c|find /i "TTL" >nul)&&  call:_GETram %%c 2>nul  ||echo %%c:  switched off
)
goto :_END
:_GETram
for /f "skip=1 delims= " %%a in ('WMIC.EXE /Node:"%1" path win32_ComputerSystem  get TotalPhysicalMemory') do (
if %%a gtr %ramsize% (
  echo %1: %%a more than 512MB updated
 ) else (
  echo %1: %%a less or equal 512MB NOT updated)
)
goto :_EOF
:_END
:_EOF

0
 
cmaitCommented:
Hi!

Here we use Windows System Center to monitor all our computers. With Windows System Center you can collect all hardware and software and you can deploy software with it. Read more about it here:
http://www.microsoft.com/systemcenter/

Another free solution you can try out is spiceworks. Read more and download here:
http://www.spiceworks.com/
0
 
canaliCommented:
Hi Sharath,
this is the script.
Bye Gas

@echo off
:: Get ram info  in "alive" computers  found in the list c:\computers.txt
:: and check for updated
::
setlocal ENABLEDELAYEDEXPANSION
::  set the RAM quantity
::  if Computer ram is > ramsize the pc is already updated

::  ramsize is 512MB
set ramsize=536330240
for /f %%c in ('type c:\computers.txt') do (
  set t=
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul)&&  call:_GETram %%c Ram: 2 && echo %%c: !t! ||echo %%c:  switched off
)
goto :_END

:_GETram
set c=
set d=%2
for /f "skip=1 delims= " %%a in ('WMIC.EXE /Node:%1  ComputerSystem  get TotalPhysicalMemory') do (
if %%a gtr %ramsize% (set d=!d! %%a more than 512MB updated
) else ( set d=!d! %%a less or equal 512MB NOT updated)
)
set t=!t! %d% %c%
goto :_EOF
:_END
:_EOF
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
bsharathAuthor Commented:
I get this.

C:\>"Getting ram.bat"
indiasophos:  switched off
Invalid Global Switch.
dev-chen-mrd100:  switched off
Invalid Global Switch.
dev-chen-nas01:  switched off
0
 
canaliCommented:
probably there is something different in your wmi
try this:
@echo off
:: Get ram info  in "alive" computers  found in the list c:\computers.txt
:: and check for updated
::
setlocal ENABLEDELAYEDEXPANSION
::  set the RAM quantity
::  if Computer ram is > ramsize the pc is already updated

::  ramsize is 512MB
set ramsize=536330240
for /f %%c in ('type computers.txt') do (
  set t=
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul)&&  call:_GETram %%c Ram: 2 && echo %%c: !t! ||echo %%c:  switched off
)
goto :_END

:_GETram
set c=
set d=%2
for /f "skip=1 delims= " %%a in ('WMIC.EXE /Node:%1  path win32_ComputerSystem  get TotalPhysicalMemory') do (
if %%a gtr %ramsize% (set d=!d! %%a more than 512MB updated
) else ( set d=!d! %%a less or equal 512MB NOT updated)
)
set t=!t! %d% %c%
goto :_EOF
:_END
:_EOF
0
 
bsharathAuthor Commented:
Still the same message
0
 
canaliCommented:
give me the output of this command
'WMIC.EXE /?|find /i "Computer"
0
 
canaliCommented:
give me the output of this command
WMIC.EXE /?|find /i "Computer"
I think there is some proplem with wmic
your computer are xp pro?
language version?
0
 
bsharathAuthor Commented:
I get this.


C:\>WMIC.EXE /?|find /i "Computer"
COMPUTERSYSTEM           - Computer system management.
CSPRODUCT                - Computer system product information from SMBIOS.
MEMPHYSICAL              - Computer system's physical memory management.
REGISTRY                 - Computer system registry management.
STARTUP                  - Management of commands that run automatically when us
ers log onto the computer system.

C:\>

I have Win 2003 and Win xp machines
All are English Versions
0
 
Farhan KaziSystems EngineerCommented:
Add double quotes with machine name:
Like:
WMIC.EXE /Node:"%1" path win32_ComputerSystem  get TotalPhysicalMemory

@echo off
:: Get ram info  in "alive" computers  found in the list c:\computers.txt
:: and check for updated
::
setlocal ENABLEDELAYEDEXPANSION
::  set the RAM quantity
::  if Computer ram is > ramsize the pc is already updated

::  ramsize is 512MB
set ramsize=536330240
for /f %%c in ('type computers.txt') do (
  set t=
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul)&&  call:_GETram %%c Ram: 2 && echo %%c: !t! ||echo %%c:  switched off
)
goto :_END

:_GETram
set c=
set d=%2
for /f "skip=1 delims= " %%a in ('WMIC.EXE /Node:"%1" path win32_ComputerSystem  get TotalPhysicalMemory') do (
if %%a gtr %ramsize% (set d=!d! %%a more than 512MB updated
) else ( set d=!d! %%a less or equal 512MB NOT updated)
)
set t=!t! %d% %c%
goto :_EOF
:_END
:_EOF
0
 
bsharathAuthor Commented:
I get this.


C:\>"Getting ram.bat"
dev-chen-mrd100:  switched off
dev-chen-pc1014:  switched off
dev-chen-srv400:  switched off
C:\>

Farhankazi

I did not understand this.

Add double quotes with machine name:
Like:
WMIC.EXE /Node:"%1" path win32_ComputerSystem  get TotalPhysicalMemory

Should i put this in the computers.txt file
0
 
canaliCommented:
@echo off
:: GetRam.cmd
:: Get ram info  in "alive" computers  found in the list c:\computers.txt
:: and check for updated with double quotes in PC name
:: try this script
::
setlocal ENABLEDELAYEDEXPANSION
::  set the RAM quantity
::  if Computer ram is > ramsize the pc is already updated

::  ramsize is 512MB
set ramsize=536330240
for /f %%c in ('type computers.txt') do (
  set t=
  (ping -n 1 -w 999 %%c|find /i "TTL" >nul)&&  call:_GETram %%c Ram: 2 && echo %%c: !t! ||echo %%c:  switched off
)
goto :_END

:_GETram
set c=
set d=%2
for /f "skip=1 delims= " %%a in ('WMIC.EXE /Node:"%1" path win32_ComputerSystem  get TotalPhysicalMemory') do (
if %%a gtr %ramsize% (set d=!d! %%a more than 512MB updated
) else ( set d=!d! %%a less or equal 512MB NOT updated)
)
set t=!t! %d% %c%
goto :_EOF
:_END
:_EOF
0
 
Farhan KaziSystems EngineerCommented:
You dont need to change anything in script I already did (i have just provided the solution of "Invalid Global Switch" error).
I think still there is some minor problem in script, wait for Canali's comment.
0
 
bsharathAuthor Commented:
I get this.


C:\>"Getting ram.cmd"
dev-chen-pc1000:  Ram: 1064288256 more than 512MB updated  less or equal 512MB NOT updated
dev-chen-mrd100:  Ram: 1600126976 more than 512MB updated  less or equal 512MB NOT updated
dev-chen-nas01:  Ram: 1610088448 more than 512MB updated  less or equal 512MB NOT updated
dev-chen-pc5000:  Ram: 1063325696 more than 512MB updated  less or equal 512MB NOT updated
dev-chen-pc5001:  Ram: 1063256064 more than 512MB updated  less or equal 512MB NOT updated
C:\>
0
 
bsharathAuthor Commented:
I got this for a machine.

C:\>"Getting ram.cmd"
dev-chen-mrd100: 1600126976 more than 512MB updated
 less or equal 512MB NOT updated
C:\>

What does this mean...
0
 
canaliCommented:
What does this mean...
It's a nightmare... there is something different in your computer...
I'm curious the output of this command?
WMIC.EXE /Node:"dev-chen-mrd100" path win32_ComputerSystem  get TotalPhysicalMemory
0
 
bsharathAuthor Commented:
I get this.

C:\>WMIC.EXE /Node:"dev-chen-mrd100" path win32_ComputerSystem  get TotalPhysica
lMemory
TotalPhysicalMemory
1600126976

What i mean to ask you is.Is this correct.The Ram sizes which the script shows are correct.
If you run it on your machine what is the output?
0
 
canaliCommented:
All the scripts are working well on different os (xp,win2k3,win2k3R2), I cant realize what happen in your PC, the incriminated lines are these:
if %%a gtr %ramsize% (
  echo %1: %%a more than 512MB updated
 ) else (
  echo %1: %%a less or equal 512MB NOT updated)
)
it's a simple if statement, probably wmic query return some blank characters more an the if is executed 2 times :first with the right ram value an second with a space then else statement is executed  and the line :
 less or equal 512MB NOT updated
is displayed. But I can't reprodruce the error...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.