troubleshooting Question

List AD User's group memberships in a listbox in 2017

Avatar of Tom Powers
Tom Powers asked on
* WMICVisual Basic.NET.NET Programming
2 Comments1 Solution222 ViewsLast Modified:
List AD User's group memberships in a listbox in 2017.
Public Sub GroupprUser()
        Dim GroupDE As New DirectoryEntry("LDAP://CN=" & txtADBox.Text & ",OU=NAZ,OU=User Accounts,DC=one,DC=xxx,DC=xxx,DC=org")

        Dim Members As Object = GroupDE.Invoke("Members", Nothing) '<<< Get members

        For Each Member As Object In CType(Members, IEnumerable)  '<<< loop through members

            Dim CurrentMember As New DirectoryEntry(txtADBox.Text) '<<< Get directoryentry for user

            MessageBox.Show(CurrentMember.Name.Remove(0, 3))  '<<< Show each user's name in a messagebox
[embed=file 1266291]
Please help EE Thanks Guys

    End Sub
Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros