Mark

Mark

  • NA
  • 3
  • 0

VB.NET to Active Directory (What am I missing here?)

Nov 24 2006 1:56 PM
Hello:

I was hoping for a bit of help. When I click on a button I want it to add a test user to Active Directory. The code debugs with no errors, but the user never shows up on my active directory list (intranet.merge3d.com\Users). All help is greatly appreciated!

Private Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click

Dim newUser As DirectoryEntry

Dim de As DirectoryEntry = New DirectoryEntry("LDAP://mcws2003.intranet.merge3d.com/CN=users;DC=intranet,DC=merge3d,DC=com")

newUser = de.Children.Add("cn=Student Smith", "user")

newUser.Properties("sAMAccountName").Add("Student_Smith")

de.CommitChanges()

MessageBox.Show("User Added")

End Sub


Answers (1)