neoseason
New member
- Joined
- Oct 11, 2007
- Messages
- 2
- Programming Experience
- 1-3
Hello
Hope I'm not ot.
I try to write some data to a simple ldap. The directory server is a OpenLdap server. I'm using InetOrgPerson schema. I'm try this one:
and work prety fine. I try it with LdapConnection.bind method.
But now I need to add a new OU then I have try something similar like this:
And I have an exception "Distinguished name is wrong or invalid". So I have try to modify ldifSTR in:
But have an exception "Object doesn't exist".
Then I have try:
But have another exception...
what's wrong ?!?!
Hope I'm not ot.
I try to write some data to a simple ldap. The directory server is a OpenLdap server. I'm using InetOrgPerson schema. I'm try this one:
VB.NET:
Dim oIdentifier As nmsLDAP.LdapDirectoryIdentifier = New nmsLDAP.LdapDirectoryIdentifier("test-srv", False, False)
Dim oConnection As nmsLDAP.LdapConnection = New nmsLDAP.LdapConnection(oIdentifier)
With oConnection
.Credential = New System.Net.NetworkCredential("cn=manager,dc=mailenable,dc=local", "password")
.Timeout = New System.TimeSpan(30000)
.AutoBind = True
.AuthType = Protocols.AuthType.Basic
.SessionOptions.ProtocolVersion = 3
.SessionOptions.AutoReconnect = True
.SessionOptions.SecureSocketLayer = False
.Timeout = New TimeSpan(0, 0, 30)
End With
and work prety fine. I try it with LdapConnection.bind method.
But now I need to add a new OU then I have try something similar like this:
VB.NET:
Dim oRequest As nmsLDAP.AddRequest = New nmsLDAP.AddRequest
Dim ldifOCS As String() = {"organizationalUnit", "top"} ''object class container
Dim ldifSTR As String = "prova.it" ''string container OU
With oRequest
.Attributes.Add(New nmsLDAP.DirectoryAttribute("objectClass", ldifOCS))
.DistinguishedName = ldifSTR
End With
''creo la response della request appena creata
Dim oResponse As nmsLDAP.AddResponse = DirectCast(oConnection.SendRequest(oRequest), nmsLDAP.AddResponse)
And I have an exception "Distinguished name is wrong or invalid". So I have try to modify ldifSTR in:
VB.NET:
Dim ldifSTR As String = "ou=prova.it"
But have an exception "Object doesn't exist".
Then I have try:
VB.NET:
Dim ldifSTR As String = "ou=prova.it,dc=mailenable,dc=local"
But have another exception...
what's wrong ?!?!