ADSI question: put methods

D

Daniel Berger

Hi all,

ruby 1.8.2 (2004-12-25) [i386-mswin32]
Windows XP Pro

I'm having a bit of trouble with the following code. I can get a
connection, and create the user, once I call setinfo. However, if I
try to use any of the put_ methods, I get an error:

require "socket"
host = Socket.gethostname

adsi = WIN32OLE.connect("WinNT://#{host},Computer")
user = adsi.create("user", "foo")
user.put_Description("test account") # Boom!
user.setinfo

However, if you replace the bad line with:

user.put("Description", "test account")

Then it works. Shouldn't it work either way?

Regards,

Dan
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top