Re: AD and VB.Net
From: Chriss3 [MVP] (noSpamHere_at_chrisse.se)
Date: 08/30/04
- Next message: DMC: "Re: Group Policies not Applied"
- Previous message: Yor Suiris: "Re: AD Contacts And Outlook"
- In reply to: Bob: "AD and VB.Net"
- Next in thread: anonymous_at_discussions.microsoft.com: "Re: AD and VB.Net"
- Reply: anonymous_at_discussions.microsoft.com: "Re: AD and VB.Net"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 30 Aug 2004 17:35:34 +0200
Bob the DN is wrong. with other words the LDAP source are wrong. I give you
an example for the DN to the administrator account
LDAP://CN=Administrator,CN=Users,DC=thelancairccompany,DC=com
More Info:
AD Schema DN Syntax:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adschema/adschema/s_object_ds_dn.asp
Choosing a AS Syntax
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ad/ad/choosing_a_syntax.asp
-- Regards Christoffer Andersson Microsoft MVP - Directory Services No email replies please - reply in the newsgroup ------------------------------------------------ http://www.chrisse.se - Active Directory Tips "Bob" <anonymous@discussions.microsoft.com> skrev i meddelandet news:093001c48ea4$e7f6d2f0$a401280a@phx.gbl... > I am having trouble getting some VB.Net code to add a > user to that AD. I'm getting a very odd error that I > can't seem to get rid of and the cause is not making > itself very clear. Not to mention the fact that finding > info on this error is rather tough. > > The error I get when try to add the user is: > > "An invalid dn syntax has been specified." > > It says it is taking place on the line of code in which I > try to set the password for the new user. > > Here is my code as it stands now: > > Dim de As New DirectoryEntry > ("LDAP://CN=Users,DC=thelancaircompany,DC=com", "tlc\admin > istrator", "Password", AuthenticationTypes.Encryption) > Dim user As DirectoryEntry = de.Children.Add > ("testa", "user") > Dim pass As New Object() > > pass = "NewPassword" > > user.Properties("SAMAccountName").Value > = "testa" > user.Properties("userPrincipalName").Value > = "testa" > user.Properties("scriptpath").Value > = "start.bat" > user.Properties("givenname").Value = "test" > user.Properties("sn").Value = "test" > user.Properties("displayname").Value = "test > a. test" > user.Properties("department").Value > = "Accounting" > user.Properties("initials").Value = "A" > user.Properties("profilepath").Value > = "\\condor\files\users\profiles\testa" '& AD1.UserName > user.Invoke("SetPassword", pass) > > user.CommitChanges() > > Any help would be greatly appreciated. > > TIA
- Next message: DMC: "Re: Group Policies not Applied"
- Previous message: Yor Suiris: "Re: AD Contacts And Outlook"
- In reply to: Bob: "AD and VB.Net"
- Next in thread: anonymous_at_discussions.microsoft.com: "Re: AD and VB.Net"
- Reply: anonymous_at_discussions.microsoft.com: "Re: AD and VB.Net"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|