win32ole, adsi and computer info
- From: "Berger, Daniel" <Daniel.Berger@xxxxxxxxx>
- Date: Wed, 31 Aug 2005 07:00:45 +0900
Hi all,
Ruby 1.8.2
Windows XP
I'm trying to get computer hardware information about a specific user on
a specific domain. I can see how to get user info and computer info,
but I don't see how to get computer info based on a userid. I was
messing around with something like this:
adsi = WIN32OLE.connect("WinNT://#{domain}")
schema = WIN32OLE.connect(adsi.schema)
if schema.container
adsi.filter = ["computer"]
adsi.each{ |obj|
p obj.name
}
else
puts "No container"
end
However, I'd rather not iterate over the entire domain.
Plus, I can't tell what methods are available to "obj", i.e. if there's
a way to tie it back to a user and/or get more detailed hardware info.
If I try to call obj.ole_methods, I get "'ole_methods': Failed to
GetTypeInfo (RuntimeError)". I get that for all of the ole_ methods on
'obj'.
Any ideas on how I can get computer info for a specific userid? Or why
obj#ole_methods fails?
Thanks.
Dan
.
- Follow-Ups:
- Re: win32ole, adsi and computer info
- From: dave . burt
- Re: win32ole, adsi and computer info
- Prev by Date: Re: [OT] Pragmatic programmers
- Next by Date: Re: rmagick question
- Previous by thread: [ANN] Nano Methods & Mega Modules
- Next by thread: Re: win32ole, adsi and computer info
- Index(es):