locked
Create LDAP users? vb RRS feed

  • Question

  • User192985886 posted

    Hi All,

    Does anyone have experience with creating users through vb.net scripting?  We have an app that authenticates through LDAP (OpenLDAP server, not an Active Directory) and are looking to manage the users through a custom web portal which I am working on, however, I am having trouble finding how to create users.

     

    Thanks

    Travis

    Monday, March 22, 2010 11:23 PM

All replies

  • User197322208 posted

    http://www.codeproject.com/KB/system/everythingInAD.aspx


    Tuesday, March 23, 2010 11:07 AM
  • User192985886 posted

     

    http://www.codeproject.com/KB/system/everythingInAD.aspx


     

    Thanks for the link, I guess I would just adapt that to LDAP://LdapServer instead of WinNT://Environment.MachineName?

    Or do I need to use something else for a non-Active Directory LDAP?

     

      Try
                Dim connectionPrefix As String = String.Empty
                connectionPrefix = "LDAP://server/ou=Users,dc=test,dc=net"
                Dim dirEntry As New DirectoryServices.DirectoryEntry(connectionPrefix, "cn=user", "password")
                Dim newUser As DirectoryServices.DirectoryEntry = dirEntry.Children.Add("cn=test,ou=Users,dc=bluelinenetworks,dc=net", "user")
                newUser.CommitChanges()
            Catch ex As System.DirectoryServices.DirectoryServicesCOMException
                Response.Write(ex.Message.ToString)
    
            End Try



    Seems to just spit out: A device attached to the system is not functioning.

    Tuesday, March 23, 2010 6:45 PM