Modifier fonction : audit configuration DNs sur carte réseau
Bonjour,
J'ai cette fonction qui me permet d'auditer les configuration DNS d'une ou des carte(s) réseaux présent sur un PC :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| ' ############ Sous fonction pour auditer la configuration DNS du poste distant ############
Sub Showdns(strServer)
strWinMgmt = "winmgmts:{impersonationLevel=impersonate}!//"& strServer &""
Set objNICs = GetObject( strWinMgmt ).InstancesOf( "Win32_NetworkAdapterConfiguration" )
WScript.echo "Hostname : " & strServer & vbCrlf
For Each objNIC In objNICs
If objNIC.IPEnabled Then
WScript.echo " - " & objNIC.Description & " : " & vbCrlf & " "
n = 1
For Each strDns In objNIC.DNSServerSearchOrder
WScript.echo vbTab & "DNS n°" & n & " : " & strDns & " "
n = n + 1
Next
WScript.echo vbCrlf
End If
Next
End Sub |
J'aimerai pouvoir filtrer les types de cartes réseau remonter (comme exclure des cartes VMware, des cartes FIREWIRE, etc..)
J'ai trouve des requette WMI de ce type pour exclure :
Code:
1 2
| Set objWMI_NETwork = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set collection_Network = objWMI_NETwork.ExecQuery("Select * from Win32_NetworkAdapter where AdapterType=""Ethernet 802.3"" and ServiceName<>""VMnetAdapter"" ") |
mais je ne sais comment modifier ma fonction en conséquence.
Merci pour votre aide.
Arnaud