日期:2014-05-17  浏览次数:20970 次

远程检测加域计算机的配置
急::::
求助各位高手:

请问有没有一种软件能检测到所有加域机器的配置包括内存、主板、cpu、硬盘大小、系统这些全部信息或者其中部分信息的?

因为要统计一下计算机台帐,一个一个跑比较麻烦,在线等……

------解决方案--------------------
'
'取得電腦的相關信息
'
'
On Error Resume Next
set wshshell=wscript.createObject("wscript.shell")
'啟動WMI服務(沒有這個服務就不行)
wshshell.run ("%comspec% /c regsvr32 /s scrrun.dll"),0,True
wshshell.run ("%comspec% /c sc config winmgmt start= auto"),0,True
wshshell.run ("%comspec% /c net start winmgmt"),0
'用一個文本來記錄硬體資訊
Set WshNetwork = WScript.CreateObject("WScript.Network")
Filename=WshNetwork.ComputerName
User=WshNetwork.UserName
computername="ComputerName=" & Filename
UserName="UserName=" & User
intime="LogonTime=" & now

Function GetMainBoard(ComputerName) '取主板資料
Dim objWMIService,ColItems,objItem,objBoard
Set objWMIService = GetObject("winmgmts:\\" & ComputerName & "\root\cimv2")
set ColItems = objwmiservice.execQuery("select * from win32_baseboard")
for each objItem in ColItems
objBoard=objItem.Product
if objBoard<>"" then
GetMainBoard=objBoard
End if
next
End Function
Board2="MainBoard=" & GetMainBoard(".")

Function GetCPU(ComputerName) 'CPU
Dim objWMIService,ColItems,objItem,objCPU
Set objWMIService = GetObject("winmgmts:\\" & ComputerName & "\root\cimv2")
set ColItems =objwmiservice.execQuery("select * from win32_processor")
for each objItem in ColItems
objCPU=objItem.Name
If objCPU <> "" Then
GetCpu=objCPU
End If
next
End Function
Cpu2="CPU=" & GetCPU(".")

Function GetRAM(ComputerName)'記憶體
Dim objWMIService,ColItems,objItem,objRAM,temp,n,S
Set objWMIService = GetObject("winmgmts:\\" & ComputerName & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PhysicalMemory",,48)
temp=0
n=0
For Each objItem in colItems
temp=temp + objitem.capacity
n=n+1
Next
objRAM="共" & temp/1048576 & "M/" & n & "條"
if objRAM <> "" then
GetRAM=objRAM 
end if
End Function
memory2="RAM=" & GetRAM(".")

'硬碟
Function GetHD(ComputerName)
Dim objWMIService,ColItems,objItem,objHD
Set objWMIService = GetObject("winmgmts:\\" & ComputerName & "\root\cimv2")
set ColItems =objwmiservice.execQuery("select * from win32_diskdrive")
for each objItem in ColItems
objHD=objItem.Model
if objHD <> "" Then
GetHD = ObjHD
end if
next
End Function
disk2="HardDisk=" & GetHD(".")

Function GetVGA(ComputerName)'顯卡
Dim objWMIService,ColItems,objItem,objVGA
Set objWMIService = GetObject("winmgmts:\\" & ComputerName & "\root\cimv2")
set ColItems = objwmiservice.execQuery("select * from win32_videocontroller",,48)
for each objitem in ColItems
objVGA= objitem.Description
if objVGA <> "" Then
GetVGA = objVGA
End if
next
End Function
video2="VGA=" & GetVGA(".")

Function GetIP(ComputerName) '取本機IP
Dim objWMIService,colItems,objItem,objAddress
Set objWMIService = GetObject("winmgmts:\\" & ComputerName & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_Netw