Solved

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

Posted on 2008-10-21
2
1,770 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
2 Comments
 
LVL 3

Accepted Solution

by:
ricardoelena 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

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Authentication type 1 27
How to best manage folder and file security 4 56
Secondary DC 3 17
ACTIVE DIRECTORY 17 21
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now