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
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