Cell variable

O

Oscar R

I'm creating a hardware asset spreadsheet. I have the computers names a
column and I'm trying to create a function to connect to the computers via
WMI and return hardware information (ie. manufacturer) to another cell.

Function GetManufacturer()

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


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

For Each objItem In colItems

GetManufacturer = objItem.Manufacturer

Next

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top