[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Script required to check number of processesors in Windows 2000,2003 and 2008 servers

Posted on 2012-08-17
8
Medium Priority
?
1,191 Views
Last Modified: 2012-08-21
Required script (VB script or any ohter) for checking processor (CPU) details on Windows Servers.
0
Comment
Question by:prakashsr
  • 2
  • 2
  • 2
  • +2
8 Comments
 

Expert Comment

by:DjRed
ID: 38307338
What details are you looking for exactly..might help in answering your question.....
0
 

Expert Comment

by:DjRed
ID: 38307358
If you are simply looking for the total number of processors (cpu cores) then this will be very helpful to you...

Delphi Code..Coded In Delphi XE2, might work fine in Delphi 7 as well (haven't tested):

program prjNumOfProcessors;

{$APPTYPE CONSOLE}

uses
SysUtils, Windows;

var
vSystemInfo : _SYSTEM_INFO;

begin
Try
  GetSystemInfo(vSystemInfo);
  WriteLN(vSystemInfo.dwNumberOfProcessors );
Except
on E:Exception do
Writeln(E.Classname, ': ', E.Message);
End;
readln;
end.

Open in new window

0
 
LVL 17

Expert Comment

by:James Haywood
ID: 38307368
This will check using WMI

To add
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery _
    ("Select * from Win32_Processor")

strComputer = "."
Set objWMIService = GetObject(_
    "winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery(_
    "Select * from Win32_Processor")
For Each objItem in colItems
    Wscript.Echo "CPU Type: " & objitem.name
Next

Open in new window


To check any other cpu properties select the info you require from

http://msdn.microsoft.com/en-us/library/windows/desktop/aa394373(v=vs.85).aspx

and add another line at the end, e.g.

Wscript.Echo "CPU Type: " & objitem.name
Wscript.Echo "Number of Cores: " & objitem.numberofcores
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 38308095
I would say, simply use systeminfo command with /s switch to specify server to check.
You may try this way. Create text file with servers name (one per line), i.e.

server1
server2
server3

and save it as servers.txt on C-Drive of any 2003/2008 server. Then run in command-line
for /f %i in (c:\servers.txt) do systeminfo /s %i | find /i "Processor(s)" >c:\%i.log

Open in new window


you will get required information about each server in named log file on C-Drive

Regards,
Krzysztof
0
 
LVL 26

Accepted Solution

by:
Leon Fester earned 1500 total points
ID: 38308982
You can use WMI queries or the systeminfo tool:
Local Machine
wmic cpu get NumberOfCores, NumberOfLogicalProcessors
Remote machine
wmic /node:<server> get NumberOfCores, NumberOfLogicalProcessors
Or:
Local machine
systeminfo
Remote Machine
systeminfo /S <server>
0
 

Author Comment

by:prakashsr
ID: 38311215
Hi iSiek,

The command is fulfill my requirement but I am getting each server out put I am getting in different .log file. Is there any way to get each server output in same .log file with server name.

for /f %i in (c:\servers.txt) do systeminfo /s %i | find /i "Processor(s)" >c:\%i.log
0
 

Author Comment

by:prakashsr
ID: 38311283
Hi,

I required to get the number of processors, server name, OS version and memory details in one file. Please can some one give script for this.
0
 
LVL 17

Expert Comment

by:James Haywood
ID: 38316999
Sydi Server does a brilliant job just running the .vbs over the network. You can simply remove the parts you don't need.

http://sydiproject.com/products/sydi-server/
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Many admins will agree: WSUS is is a nice invention but using it on the client side when updating a newly installed computer is still time consuming as you have to do several reboots and furthermore, the procedure of installing updates, rebooting an…
INTRODUCTION The purpose of this document is to demonstrate the Installation and configuration of the Data Protection Manager product. Note that this demonstration was prepared on the basis of Windows OS is 2008 R2 and DPM 2010. DATA PROTECTI…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Suggested Courses

873 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