Bonjour a tous


Je recherche le moyen de mettre un timeOut sur une requette WMI utiliser avec System.Management.

Je souhaite lister tout les partages administratif d'une liste de 1500 machines La Class Wmi est Win32_Share

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
                    Try
                        Dim connection As New ConnectionOptions
                        connection.Username = "xxxxx\xxxxx"
                        connection.Password = "xxxxxxxx"
                        '  connection.Authority = "ntlmdomain:xxxxx"
 
                        Dim scope As New ManagementScope(New ManagementPath("\\" & ListBox1.Items(t) & "\root\CIMV2"), connection)
                        scope.Connect()
 
                        Dim query As New ObjectQuery("SELECT * FROM Win32_Share")
                        Dim searcher As New ManagementObjectSearcher(scope, query)
 
                        For Each queryObj As ManagementObject In searcher.Get()
                            Console.WriteLine("Name: {0}", queryObj("Name"))
                        Next
                        worker.ReportProgress(t, "Partage assecible")
                    Catch ex As Exception
                        worker.ReportProgress(t, "Partage non assecible")
                    End Try

Cordialement,
Troxsa