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?
Bookmarks