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=""+chr(10)+"Дата сбора: " & invdate & ""+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+"" + chr(10) temp=temp+""+chr(10) temp=temp+"" + chr(10) temp=temp+""+chr(10) temp=temp+"" + chr(10) temp=temp+""+chr(10) compname=objitem.name case 1 temp=temp+""+chr(10) temp=temp+""+chr(10) temp=temp+""+chr(10)+"" temp=temp+""+chr(10) case 2 s=s+1 temp=temp+""+chr(10)+""+chr(10)+"" temp=temp+""+chr(10) case 3 i=i+1 temp=temp+""+chr(10)+""+chr(10)+"" + chr(10) temp=temp+""+chr(10) case 4 temp=temp+""+chr(10)+""+chr(10)+"" temp=temp+""+chr(10) case 5 if objitem.adaptertypeid=0 and objitem.netconnectionstatus=2 then temp=temp+""+chr(10)+""+chr(10) temp=temp+"" temp=temp+""+chr(10) end if case 6 temp=temp+""+chr(10)+""+chr(10) temp=temp+""+chr(10) case 7 temp=temp+""+chr(10)+""+chr(10) temp=temp+""+chr(10) case 8 d=d+1 temp=temp+""+chr(10)+""+chr(10)+"" temp=temp+""+chr(10) end select next next 'Заключительная часть temp=temp+"
" temp=temp+"Имя компьютера"+""+objitem.name+ "
" temp=temp+"Оперативная память"+""+cstr(round(objitem.totalphysicalmemory/constmb))+ " MB
" temp=temp+"Модель компьютера"+""+objitem.model+ "
" temp=temp+"Материнская плата"+""+objitem.SMBIOSBIOSVersion+"
" temp=temp+"BIOS"+"" + objitem.caption+""+chr(10)+"
" temp=temp+"Процессор"+cstr(s)+""+objitem.name+" Частота "+cstr(objitem.CurrentClockSpeed)+chr(10)+"
" if objitem.size > 0 then ' = nill then sizegb=cstr(round(objitem.size/constgb,2)) else sizegb=cstr(0) end if temp=temp+"Жесткий диск "+cstr(i)+""+objitem.model + " " + sizegb + " GB
" temp=temp+"Видеоконтролер"+""+objitem.caption+chr(10)+"
" temp=temp+"Сетевой адаптер"+""+objitem.name+chr(10)+"
" temp=temp+"Звуковая карта"+""+objitem.caption+chr(10)+"
" temp=temp+"SCSI Адаптер"+""+objitem.manufacturer+" "+objitem.caption+chr(10)+"
" temp=temp+"Принтер "+cstr(d)+""+objitem.name+chr(10)+"
" 'Запись файла Dim fso, tf Set fso = CreateObject("Scripting.FileSystemObject") Set tf = fso.CreateTextFile(""&compname&".htm", True) tf.Write (temp) tf.Close next