Lister les utilisateur d'un groupe ACTIVE DIRECTORY
Bonjour All,
Bon j'utilise VB express 2010 et je veux lister tous les utilisateurs d'un groupe "group1" dans une listebox. Jusqu'à maintenant je peux me connecter et accéder au domaine.
Voici mon code VB :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Imports System.DirectoryServices
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Ldap As DirectoryEntry = New DirectoryEntry("LDAP://192.168.1.1", "oussama", "toto")
Dim searcher As New DirectorySearcher(Ldap)
searcher.Filter = "(SAMAccountName=group1)"
Dim DirEntry As DirectoryEntry
For Each result As SearchResult In searcher.FindAll()
DirEntry = result.GetDirectoryEntry
ListBox1.Items.Add(DirEntry.Properties("member").Value)
Next
End Sub
End Class |
Quand je clique sur bouton1 dans la listebox il s'affiche : Tableau de Object[]
Merci d'avance,