Re: AD/ADAM Create User (VB.Net)
- From: "Joe Kaplan" <joseph.e.kaplan@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Nov 2006 16:16:07 -0600
You might like ch 10 of our book to help with some of this stuff. It is
free from the website in my sig. There is also free VB.NET code on the site
from the book.
There are also a few ADAM specific things to do here. You need to specific
the application partition NC Name in your binding string in order for LDAP
to know where in ADAM to put the user:
LDAP://adamdnsname/OU=Users,O=myadampartition
(or whatever you created there)
Also, what is the value of strUser in the code below? It needs to be in
"RDN" format, ie "cn=someuser", assuming that you are creating an object
with the ADAM user schema and not something else.
Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"
http://www.directoryprogramming.net
--
"will" <will@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8C425E14-D43A-442F-A500-863F6DC68EE0@xxxxxxxxxxxxxxxx
I'm receiving the following error when attempting add a new user to the
AD.
The user account used have enterprise level rights. Any help would be
greatly
appreciated. Thanks! - Will
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@xxxxxxxxxxxxxxxxx"
'
strUser = "CN=" & lastname & "," & firstname
strDisplayName = lastname & "," & firstname
strUserPrincipalName = email
.
- Follow-Ups:
- Re: AD/ADAM Create User (VB.Net)
- From: will
- Re: AD/ADAM Create User (VB.Net)
- Prev by Date: Re: DNS Record Removal
- Next by Date: Re: Administrative templates
- Previous by thread: Re: DNS Record Removal
- Next by thread: Re: AD/ADAM Create User (VB.Net)
- Index(es):
Relevant Pages
|