Hallo,
ich brauche eine Funktion der man den Ethernet Adapternamen(z.B.: "LAN-Verbindung") übergibt und darüber dann Informationen zurück bekommt.
Mich interessieren im Grunde alles was "IPconfig /all" ausgibt.
Verbindungsspezifisches DNS-Suffix:
Beschreibung. . . . . . . . . . . :
Physikalische Adresse . . . . . . :
DHCP aktiviert. . . . . . . . . . :
Autokonfiguration aktiviert . . . :
IPv4-Adresse . . . . . . . . . . :
Subnetzmaske . . . . . . . . . . :
Standardgateway . . . . . . . . . :
DNS-Server . . . . . . . . . . . :
NetBIOS über TCP/IP . . . . . . . :
Diese Funktion von veronesi Funktioniert heute noch gut aber liefert leider nicht geügend Infos. Hat jemand von euch eine Idee wie bzw ob man diese dahingehend erweitern kann um alle Infos zu bekommen? Und wie man dieser Funktion den Adapthernamen übergeben kann?
[autoit]#include <Array.au3>
[/autoit][autoit][/autoit][autoit]Global $Info = _GetNetworkInformations()
Global $NumberOfAdapters = @extended
Global $sTitle = "Index "
For $i = 1 To $NumberOfAdapters
$sTitle &= "| Adapter " & $i
Next
_ArrayDisplay($Info, "Network Informations", -1, 0, "", "", $sTitle)
For $Adapter = 0 To UBound($Info, 2) - 2
MsgBox(64, "Beschreibung von Adapter " & $Adapter + 1, $Info[1][$Adapter])
MsgBox(64, "MAC von Adapter " & $Adapter + 1, $Info[2][$Adapter])
MsgBox(64, "DHCP von Adapter " & $Adapter + 1, $Info[3][$Adapter])
MsgBox(64, "IP (DHCP) von Adapter " & $Adapter + 1, $Info[4][$Adapter])
For $i = 5 To $Info[0][$Adapter]
MsgBox(64, "IP " & $i - 4 & " von Adapter " & $Adapter + 1, $Info[$i][$Adapter])
Next
Next
;==================================================================================
; Function: _GetNetworkInformations()
; Description: Returns an array with some informations about all network cards
; Parameter(s): -
;
; Return Value(s): On Success: Return Array
; Column 0 Column 1 Column 2...
; Index 0 : Number of Indexes in this column
; Index 1 : Network Card Description
; Index 2 : MAC Address
; Index 3 : DHCP Enabled?
; Index 4 : IP of DHCP Server
; Index 5 : IP-Address 1
; Index 6 : IP-Address 2
; Index n : IP-Address n
;
; @Extended = Number of Adapters found
;
; On Failure: Sets @ERROR to none zero
; Author(s): Veronesi
; Note(s):
;==================================================================================
#include-once
[/autoit][autoit][/autoit][autoit]Func _GetNetworkInformations()
[/autoit][autoit][/autoit][autoit]Local $oWMI = ObjGet("Winmgmts:\\.\root\cimv2")
If Not IsObj($oWMI) Or @error Then Return SetError(1, 1, 0)
Local $oInstances = $oWMI.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=TRUE")
Local $aNetworkAdapter[1][1], $aIP, $Row = 1, $Column = 0, $MaxRow = 0
For $oInstance In $oInstances
With $oInstance
$Row = 1
ReDim $aNetworkAdapter[100][$Column + 1]
$aNetworkAdapter[$Row][$Column] = .Description
$Row += 1
ReDim $aNetworkAdapter[100][$Column + 1]
$aNetworkAdapter[$Row][$Column] = .MACAddress
$aNetworkAdapter[$Row + 1][$Column] = .DHCPEnabled
$aNetworkAdapter[$Row + 2][$Column] = .DHCPServer
$Row += 3
$aIP = .IPAddress
For $i = 0 To UBound($aIP) - 1
ReDim $aNetworkAdapter[100][$Column + 1]
$aNetworkAdapter[$Row][$Column] = $aIP[$i]
$Row += 1
Next
If $MaxRow < $Row Then $MaxRow = $Row
$aNetworkAdapter[0][$Column] = $Row - 1
$Column += 1
EndWith
Next
ReDim $aNetworkAdapter[$MaxRow][$Column + 1]
$oInstance = 0
$oInstances = 0
$oWMI = 0
Return SetError(0, $Column, $aNetworkAdapter)
EndFunc ;==>_GetNetworkInformations