Solved

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

Posted on 2008-10-21
2
1,803 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
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…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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