Solved

How to add user to a LDAP group with VB.net

Posted on 2008-10-21
2
1,799 Views
Last Modified: 2013-12-19
Need to know how to add a user to a group within AD using VS 2005 VB.net.  Trying to interface an application with AD to add the users to AD and then put them in a specific group.
0
Comment
Question by:fdenison
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
Ricardo Elena earned 125 total points
ID: 22769189

these migth help
Dim directory As New DirectoryServices.DirectoryEntry("WinNT://" + Environment.MachineName + ",computer")
Dim new_user As DirectoryServices.DirectoryEntry = directoria.Children.Add("User1000", "user")
new_user.CommitChanges()
Dim groups As DirectoryServices.DirectoryEntry
groups = directory.Children.Find("Administrator", "group")
If groups.Name <> "" Then
MsgBox("Add....")
new_user.Invoke("Add", New Object() {new_user.Name.ToString})
MsgBox("Added.....")
Else
MsgBox("Nothing")
End If
0
 

Author Closing Comment

by:fdenison
ID: 31508257
Thank you for your input, your suggestion was helpful, we ended up having a permissions issue with AD your code helped us to write some error checking to find the issue.  Thank you.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question