I have a few pieces of code in my project that "work" but neither give me exactly what I want. I need to pass in a Group and get as much information as I can: username, full name, samaccountname, etc.
Right now all I get from this code is "CN=lastname,/ firstname "description of user" And I can't do anything with it. Can someone modify this code or give me new code to get what I need?
Dim strName As String
Dim GroupSearcher As New DirectorySearcher
Dim GroupSearchRoot As New DirectoryEntry("LDAP://" & Domain, Username, Password)
.SearchRoot = GroupSearchRoot
.Filter = "(&(ObjectClass=Group)(CN=TRAUser))"
Dim Members As Object = GroupSearcher.FindOne.GetDirectoryEntry.Invoke("Members", Nothing) '<<< Get members
For Each Member As Object In CType(Members, IEnumerable)
Dim CurrentMember As New DirectoryEntry(Member)
strName = (CurrentMember.Name) '.Remove(0, 3))