Greetings, I've taken a script to collect computer information and modified it for our IT dept needs, but I don't know how to capture errors. I only know how to do on error resume next when looping through ip addresses. What would be neat is if I could capture the error info and move on to the next one. Does anybody have any ideas? Thanks.
I'm looping through a list of ip addresses. some don't really exist and some of the users don't have their machines turned on. Either way, if I comment out the on error statement, it kills my script. Many thanks!!
Code:
' Get Model, Manufacturer, Computername and Memory
Set CompSysSet = GetObject(strWinMgt).ExecQuery("select * from Win32_ComputerSystem")
For Each CompSys In CompSysSet
strModel = CompSys.Model
ComputerName = CompSys.Name
strVendor = CompSys.Manufacturer
intRAM = Clng(CompSys.TotalPhysicalMemory/1048576 )
Next