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



Hello Joe:

Thanks for the response. The values I used for the

strUser = "CN=lastname , firstname"
userPrincipalName = "tuser@xxxxxxxxxxxxxxxxx"
displayName = "lastname , firstname"

The objADAM a DirectoryEntry object. How do I know what schema is being
used? I'm confused about Active Directory and ADAM - they appear to be
interchangable terms yet with what I've read thus far there is a slight
difference. The target servers are Win 2003, developement box is WinXP Pro. I
installed ADAM adsiedit but I can't find the GAL entries.

When I look at the GAL via outlook, the far right column (Email) of the
address book shows the hierachy of the contact entry. An example,
/o=SIS/ou=First Group/cn=Recipients/cn=1test.

So while I'm in ADAM adsiedit I specify cn=Recipients and expect to get a
listing of the entries under that cn. In stead when I enter cn=Recipients
ADAm tool errors with "subref missing". Sorry for the off-topic ADAM issue
but I was hoping that a tool could provide me with some insight to the
AD/ADAM. I'm going to buy your book today. I did use the code fragments to
create a user for what I have now but I'm lacking the basic AD/ADAM knowledge.

Thanks again,
-Will

I

"Joe Kaplan" wrote:

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







.



Relevant Pages

  • Re: ADAM and AuthorizationStoreRoleProvider
    ... ADAM roles to ADAM users only. ... // Global connection string, generic exception message, event ... foreach (string rolename in rolenames) ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Dynamic QueryString!
    ... > Hi Adam, ... > The function would be of type string and receive the dataitem as a string ... > Ken Dopierala Jr. ... >> I am wanting to url the HyperLink server control in a datagrid. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: AD/ADAM Create User (VB.Net)
    ... There are also a few ADAM specific things to do here. ... the application partition NC Name in your binding string in order for LDAP ... strUserPrincipalName) ... Dim firstname As String = "user" ...
    (microsoft.public.windows.server.active_directory)
  • Re: Authenticating Web user and domain User with ADAM
    ... Whit this System.Web configuration of my web.config file I'm able to ... connect to My adam partition. ... classOBJ the name of the class to be used to create the entry ... string classObj, string pwd) ...
    (microsoft.public.windows.server.active_directory)
  • Re: Worksheet_Change not updating with vlookup change
    ... Target bit in, that is your error. ... "Adam" wrote in message ... Dim rng As Range ... Dim vRngInput As Variant ...
    (microsoft.public.excel.programming)