dim strclass, objAD, obj 
dim invdate 
dim constmb, constgb, sizegb 
dim compname, temp, compad 
constmb=1048576 
constgb=1073741824 
strclass = array( "win32_ComputerSystem", "win32_bios", "win32_processor",_ 
"win32_diskdrive", "win32_videocontroller", "win32_NetworkAdapter",_ 
"win32_sounddevice", "win32_SCSIController", "win32_printer") 

set objAD=getobject("LDAP://CN=Computers,DC=akos-nissan,DC=local") 
objAD.filter=array("computer") 
on error resume next 
for each obj in objAD 
CompAD=right(obj.name, len(obj.name)-3) 
invdate = date 
temp="<html>"+chr(10)+"Дата сбора: " & invdate & "<table>"+chr(10) 
compname="" 
' on error resume next 
set objWMIService = GetObject("winmgmts://"&CompAD&"/root\cimv2") 
i=0 
s=0 
d=0 
q=0 
' sizegb="" 
for a=0 to 8 
Set colitems = objwmiservice.instancesof(strclass(a)) 
for each objitem in colitems 
select case a 
case 0 
temp=temp+"<tr><td>" 
temp=temp+"Имя компьютера"+"</td><td>"+objitem.name+ "</td>" + chr(10) 
temp=temp+"</tr>"+chr(10) 
temp=temp+"<tr><td>" 
temp=temp+"Оперативная память"+"</td><td>"+cstr(round(objitem.totalphysicalmemory/constmb))+ " MB</td>" + chr(10) 
temp=temp+"</tr>"+chr(10) 
temp=temp+"<tr><td>" 
temp=temp+"Модель компьютера"+"</td><td>"+objitem.model+ "</td>" + chr(10) 
temp=temp+"</tr>"+chr(10) 
compname=objitem.name 
case 1 
temp=temp+"<tr><td>" 
temp=temp+"Материнская плата"+"</td><td>"+objitem.SMBIOSBIOSVersion+"</td>"+chr(10) 
temp=temp+"</tr>"+chr(10) 
temp=temp+"<tr><td>" 
temp=temp+"BIOS"+"</td><td>" + objitem.caption+"</td>"+chr(10)+"<td>"+chr(10)+"</td>" 
temp=temp+"</tr>"+chr(10) 
case 2 
s=s+1 
temp=temp+"<tr>"+chr(10)+"<td>" 
temp=temp+"Процессор"+cstr(s)+"</td>"+chr(10)+"<td>"+objitem.name+" Частота "+cstr(objitem.CurrentClockSpeed)+chr(10)+"</td>" 
temp=temp+"</tr>"+chr(10) 
case 3 
i=i+1 
temp=temp+"<tr>"+chr(10)+"<td>" 
if objitem.size > 0 then ' = nill then 
sizegb=cstr(round(objitem.size/constgb,2)) 
else 
sizegb=cstr(0) 
end if 
temp=temp+"Жесткий диск "+cstr(i)+"</td>"+chr(10)+"<td>"+objitem.model + " " + sizegb + " GB</td>" + chr(10) 
temp=temp+"</tr>"+chr(10) 
case 4 
temp=temp+"<tr>"+chr(10)+"<td>" 
temp=temp+"Видеоконтролер"+"</td>"+chr(10)+"<td>"+objitem.caption+chr(10)+"</td>" 
temp=temp+"</tr>"+chr(10) 
case 5 
if objitem.adaptertypeid=0 and objitem.netconnectionstatus=2 then 
temp=temp+"<tr>"+chr(10)+"<td>" 
temp=temp+"Сетевой адаптер"+"</td>"+chr(10) 
temp=temp+"<td>"+objitem.name+chr(10)+"</td>" 
temp=temp+"</tr>"+chr(10) 
end if 
case 6 
temp=temp+"<tr>"+chr(10)+"<td>" 
temp=temp+"Звуковая карта"+"</td>"+chr(10) 
temp=temp+"<td>"+objitem.caption+chr(10)+"</td></tr>"+chr(10) 
case 7 
temp=temp+"<tr>"+chr(10)+"<td>" 
temp=temp+"SCSI Адаптер"+"</td>"+chr(10) 
temp=temp+"<td>"+objitem.manufacturer+" "+objitem.caption+chr(10)+"</td></tr>"+chr(10) 
case 8 
d=d+1 
temp=temp+"<tr>"+chr(10)+"<td>" 
temp=temp+"Принтер "+cstr(d)+"</td>"+chr(10)+"<td>"+objitem.name+chr(10)+"</td>" 
temp=temp+"</tr>"+chr(10) 
end select 
next 
next 
'Заключительная часть 
temp=temp+"</table></html>" 
'Запись файла 
Dim fso, tf 
Set fso = CreateObject("Scripting.FileSystemObject") 
Set tf = fso.CreateTextFile(""&compname&".htm", True) 
tf.Write (temp) 
tf.Close 
next
sbor_informacii_o_domennyx_kompjuterax.txt · Последние изменения: 2013/10/23 15:39 (внешнее изменение)
GNU Free Documentation License 1.3
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 Яндекс.Метрика