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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding CPU Speed for all PC's on Network

Status
Not open for further replies.

kachbo1

IS-IT--Management
Nov 16, 2004
40
GB
Hi,

Has anyone got a vbscript which will give me the hardware info such as processor speed, ram etc in the form of either a txt, csv file.

We are on a windows 2000 Network
 
kachbo1,

Try the following script:

'System_Info.vbs
'Uses WMI to retrieve system information

Set WshNetwork = WScript.CreateObject("WScript.Network")
strComputer = WshNetwork.ComputerName

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Srcpath = objFSO.GetAbsolutePathName(".") 'Use curent path as destination
Set objTextFile = objFSO.OpenTextFile(Srcpath + "\" & strComputer & ".XLS", ForWriting, True)

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_ComputerSystem")

For Each objComputer in colSettings

HostName = objComputer.Name
Wscript.Echo "Host Name: " & HostName

SystemManufacturer = Trim(objComputer.Manufacturer)
Wscript.Echo "System Manufacturer: " & SystemManufacturer

SystemModel = Trim(objComputer.Model)
Wscript.Echo "System Model: " & SystemModel

TotalMemoryF = FormatNumber((objComputer.TotalPhysicalMemory)/1046856, 0, GroupDigit)
If TotalMemoryF = 511 Then TotalMemoryF = 512
TotalMemory = TotalMemoryF & " MB"
Wscript.Echo "Total Physical Memory: " & TotalMemory

Next

Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_Processor")

For Each objProcessor in colSettings

ProcessorType = Trim(objProcessor.Description)
Wscript.Echo "Processor Type: " & ProcessorType

ProcessorName = Trim(objProcessor.Name)
Wscript.Echo "Processor Name: " & ProcessorName

ClockSpeedF = FormatNumber((objProcessor.CurrentClockSpeed/1000), 1)
ClockSpeed = ClockSpeedF & " GHz"
Wscript.Echo "Clock Speed: " & ClockSpeed

ProcessorID = objProcessor.DeviceID
Wscript.Echo "Processor ID: " & ProcessorID

Next

Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_BIOS")

For Each objBIOS in colSettings

BiosVersion = objBIOS.Version
Wscript.Echo "BIOS Version: " & BiosVersion

Next

'Write header
objTextFile.WriteLine("Host Name" & vbTab & "System Manufacturer" & vbTab & "System Model" & vbTab & "Total Memory" & vbTab & "Processor Type" & vbTab & "Processor Name" & vbTab & "Clock Speed"& strvirus2 & vbTab & "Proceesor ID" & vbTab & "BIOS Version")

objTextFile.WriteLine(HostName & vbTab & SystemManufacturer & vbTab & SystemModel & vbTab & TotalMemory & vbTab & ProcessorType & vbTab & ProcessorName & vbTab & ClockSpeed & vbTab & ProcessorID & vbTab & BIOSVersion)

objTextFile.Close
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top