Results 1 to 3 of 3

Thread: AD/ADAM Create User (VB.Net)

  1. #1
    Join Date
    Oct 2005
    Posts
    52

    AD/ADAM Create User (VB.Net)

    We are running a server with AD. Whenever I’m trying to add any new user on the AD, I get the following error message:

    An invalid dn syntax has been specified. (Exception from HRESULT: 0x80072032)"

    CODE:

    Try
    objADAM = New DirectoryEntry("LDAP://<domain>.com, "userid", "password",
    AuthenticationTypes.Secure)
    objADAM.RefreshCache()
    '
    objUser = objADAM.Children.Add(strUser, "user")
    objUser.Properties("displayName").Add(strDisplayName)
    objUser.Properties("userPrincipalName").Add( _
    strUserPrincipalName)
    objUser.CommitChanges()
    Catch ....

    Dim lastname As String = "test"
    Dim firstname As String = "user"
    Dim email As String = "tuser@casmanagerpro.com"
    '
    strUser = "CN=" & lastname & "," & firstname
    strDisplayName = lastname & "," & firstname
    strUserPrincipalName = email


    I’m not able to get the cause of this error because the user accounts have enterprise level rights and still it is giving me the error. Can you help me with this?

  2. #2
    Join Date
    Sep 2004
    Posts
    66

    Re: AD/ADAM Create User (VB.Net)

    There are some ADAM specific stuffs which needs to be carried out here. You will need a specific application partition NC Name in your binding string in order for LDAP to know where in ADAM to put the user. You can do this with the following command:

    LDAP://adamdnsname/OU=Users,O=myadampartition

    Apart from this, one thing i would like to know is whats the value of strUser in the code? As far as i know it requires to be in "RDN" format, ie "cn=someuser", assuming that you are creating an object with the ADAM user schema and not something else.

    See if it helps.

  3. #3
    Join Date
    Oct 2005
    Posts
    52

    Re: AD/ADAM Create User (VB.Net)

    Thanks for the help counselor. The values I used were as follows:

    strUser = "CN=lastname , firstname"
    userPrincipalName = "tuser@casmanagerpro.com"
    displayName = "lastname , firstname"

    How do I know what schema is being used?

Similar Threads

  1. How to create PDF User's Guide
    By Unnati in forum Windows Software
    Replies: 6
    Last Post: 27-07-2011, 08:20 PM
  2. Replies: 1
    Last Post: 22-05-2011, 03:41 AM
  3. Create a user account in Mac OS X
    By Mac rumor in forum Tips & Tweaks
    Replies: 1
    Last Post: 03-02-2010, 10:41 PM
  4. Issue while setting user password in ADAM using JAVA
    By VinodMaladkar in forum Active Directory
    Replies: 4
    Last Post: 08-07-2009, 05:25 PM
  5. ADAM can't logon with any user, except domain user
    By stevieB in forum Active Directory
    Replies: 5
    Last Post: 26-01-2008, 11:57 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,322,487.77701 seconds with 17 queries