Im trying to to simply list all security groups from active directory as i will then be doing checks on folders with the mathcing security group.

I can list all the users from active directory with this:

Dim myDirectoryEntry As DirectoryEntry = New DirectoryEntry(String.Format("LDAP://DC=domain,DC=org"))
        Dim mySearcher As DirectorySearcher = New DirectorySearcher(myDirectoryEntry)
        Dim mySort As SortOption = New SortOption("sn", SortDirection.Ascending)
        mySearcher.Filter = ("(objectClass=user)")
        mySearcher.Sort = mySort
        For Each resEnt As SearchResult In mySearcher.FindAll()
                'If Not String.IsNullOrEmpty(resEnt.Properties("Mail")(0).ToString()) _
                '    AndAlso System.Text.RegularExpressions.Regex.IsMatch(resEnt.Properties("DisplayName")(0).ToString(), " |admin|test|service|system|[$]", System.Text.RegularExpressions.RegexOptions.IgnoreCase) Then
                Dim space As Integer = resEnt.Properties("DisplayName")(0).ToString().IndexOf(" ")
                Dim formattedName As String = String.Format("{0}{1}{2}", _
                                                            resEnt.Properties("DisplayName")(0).ToString().Substring(space).PadRight(25), _
                                                            resEnt.Properties("DisplayName")(0).ToString().Substring(0, space).PadRight(15), _
                                                            resEnt.Properties("Mail")(0).ToString() _
                'End If
                badEntries = badEntries + 1
            End Try

but all want all the confugred security groups/users

wondered if anyone had any ideas?

what is the requirement on hardware and operanting system solution would prensent.If a gorvernment company ask u to builds some computers for them.

This article has been dead for over six months. Start a new discussion instead.