# Creating LDAP (specifically, Active Directory) records

**URL:** <https://www.ruby-forum.com/t/creating-ldap-specifically-active-directory-records/79882>\
**Category:** Rails\
**Created:** [December 20, 2006, 7:30am UTC](https://www.ruby-forum.com/t/creating-ldap-specifically-active-directory-records/79882 "2006-12-20T07:30:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sterling\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ce73a5/32.png) [@Sterling\_A](https://www.ruby-forum.com/u/Sterling_A)\
**Post date:** [December 20, 2006, 7:30am UTC](https://www.ruby-forum.com/t/creating-ldap-specifically-active-directory-records/79882/1 "2006-12-20T07:30:50Z")

</div>

Has anyone done anything with creating LDAP records? I’ve got an app  
that needs to talk to my AD domain and ideally create new accounts,  
but I’m having a hard time finding information on if anyone has  
published anything regarding the creation of new accounts.

–  
Sterling A.  
sterling [at] [sterlinganderson.net](http://sterlinganderson.net)  
[http://sterlinganderson.net/](http://sterlinganderson.net/)  
608.239.8387

---

<div class="post-metadata">

**Author:** ![Sterling\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ce73a5/32.png) [@Sterling\_A](https://www.ruby-forum.com/u/Sterling_A)\
**Post date:** [December 20, 2006, 5:11pm UTC](https://www.ruby-forum.com/t/creating-ldap-specifically-active-directory-records/79882/2 "2006-12-20T17:11:23Z")

</div>

Sterling A. wrote:

> Has anyone done anything with creating LDAP records? I’ve got an app  
> that needs to talk to my AD domain and ideally create new accounts,  
> but I’m having a hard time finding information on if anyone has  
> published anything regarding the creation of new accounts.
> 
> –  
> Sterling A.  
> sterling [at] [sterlinganderson.net](http://sterlinganderson.net)  
> [http://sterlinganderson.net/](http://sterlinganderson.net/)  
> 608.239.8387

If you’re talking about how to actually create LDAP records using Ruby,  
look at the Net::LDAP library on Rubyforge, specifically the  
Net::LDAP#add and #modify methods. If your question relates to  
integrating with Rails, or to peculiarities of AD, then please ask a  
more specific question.

---

<div class="post-metadata">

**Author:** ![Sterling\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ce73a5/32.png) [@Sterling\_A](https://www.ruby-forum.com/u/Sterling_A)\
**Post date:** [December 20, 2006, 8:21pm UTC](https://www.ruby-forum.com/t/creating-ldap-specifically-active-directory-records/79882/3 "2006-12-20T20:21:29Z")

</div>

I’ve done a bit of work on this (querying only)

Here are some resources…  
[http://ruby-ldap.sourceforge.net/](http://ruby-ldap.sourceforge.net/)  
[http://rubyforge.org/projects/ruby-activeldap/](http://rubyforge.org/projects/ruby-activeldap/)

On 12/19/06 3:15 PM, “Sterling A.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Sterling\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ce73a5/32.png) [@Sterling\_A](https://www.ruby-forum.com/u/Sterling_A)\
**Post date:** [December 20, 2006, 8:32pm UTC](https://www.ruby-forum.com/t/creating-ldap-specifically-active-directory-records/79882/4 "2006-12-20T20:32:25Z")

</div>

Sterling A. wrote:

> Has anyone done anything with creating LDAP records? I’ve got an app  
> that needs to talk to my AD domain and ideally create new accounts,  
> but I’m having a hard time finding information on if anyone has  
> published anything regarding the creation of new accounts.
> 
> –  
> Sterling A.  
> sterling [at] [sterlinganderson.net](http://sterlinganderson.net)  
> [http://sterlinganderson.net/](http://sterlinganderson.net/)  
> 608.239.8387

Another thing I just thought of: if you’re creating records, you need to  
obey the schema constraints. (Practically, there are certain required  
attributes you will need to populate in order to successfully add the  
record.) In A/D, some of these are built in, and you may also have some  
local ones you need to worry about.

I gave an incorrect link to Net::LDAP upthread. In Rubyforge, look for  
net-ldap.

---

<div class="post-metadata">

**Author:** ![Sterling\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ce73a5/32.png) [@Sterling\_A](https://www.ruby-forum.com/u/Sterling_A)\
**Post date:** [January 24, 2007, 6:01am UTC](https://www.ruby-forum.com/t/creating-ldap-specifically-active-directory-records/79882/5 "2007-01-24T06:01:26Z")

</div>

Is there an update to the ruby-net-ldap package? I was hoping a new  
release was out that would allow storing the returned object or record  
in a session. I asked about this a few months ago and you mentioned a  
newer release soon to be out. However, I recently checked and still no  
joy. I’m sure your busy but is there an ETA.

Thanks,  
Phill

On Dec 20 2006, 12:32 pm, Francis C.
