# WMI and WIN32OLE issues

**URL:** <https://www.ruby-forum.com/t/wmi-and-win32ole-issues/73744>\
**Category:** Ruby\
**Created:** [October 26, 2006, 8:12pm UTC](https://www.ruby-forum.com/t/wmi-and-win32ole-issues/73744 "2006-10-26T20:12:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8797f3/32.png) [@spike](https://www.ruby-forum.com/u/spike)\
**Post date:** [October 26, 2006, 8:12pm UTC](https://www.ruby-forum.com/t/wmi-and-win32ole-issues/73744/1 "2006-10-26T20:12:33Z")

</div>

Hello,

Having difficulty pulling information from a remote system with Ruby  
and WMI. In the past, I’ve used [VB.NET](http://VB.NET) for WMI access. Some code ideas  
have moved over quickly, but others stymie me.

For quick inventory management, I’d like to connect to other network  
PCs, grab some data, and pass it along to another system for storage.  
I’ve used Microsoft’s WMI tools to ID classes and methods I care about.  
Here’s an example:

Remote host: Dell\_1  
Class: MPIO\_WMI\_METHODS  
Method from that class: GetPathConfiguration

GetPathConfiguration returns a struct with three members, Description  
(string), Implemented (boolean), and WmiMethodId (sint32).

Maybe I know too little about WMI or WIN32OLE objects, but it seems to  
me this should work:

```
  #locate MPIO devices, if installed
  mpio_locator = WIN32OLE.new("WbemScripting.SWbemLocator")
  mpio_server =

```

mpio\_locator.ConnectServer(“Dell\_1”,“root\wmi”,“Administrator”,password)  
mpio = mpio\_server.InstancesOf(“MPIO\_WMI\_METHODS”)

That all works fine. The next part does not.

```
  #next line triggers "unknown property or method

```

`GetPathConfiguration’"  
devices = mpio.GetPathConfiguration()  
devices.each do |device|  
puts “#{device.Description}  
”  
end

Is there a syntax to calling the method I’m messing up? Something else  
obvious?

Spike
