Solved

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

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Let's recap what we learned from yesterday's Skyport Systems webinar.
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

627 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