Jump to content

coolity

Members
  • Gesamte Inhalte

    2
  • Registriert seit

  • Letzter Besuch

Beiträge erstellt von coolity

  1. Hallo Zusammen,

     

    ich hab ein vbs script das mir alles aktivierten IP Addressen ausliest. Ich benötige aber auch noch die Subnetz Maske das Default Gateway und eventuell noch die MAC Addresse.

     

    Hier das Script:

     

    public ip

    public mask

     

    function GetAllIP

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    Set IPConfigSet = objWMIService.ExecQuery _

    ("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

    For Each IPConfig in IPConfigSet

    If Not IsNull(IPConfig.IPAddress) Then

    For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)

    ip = ip & IPConfig.IPAddress(i) & VbCrLf

    Next

    End If

    Next

    GetAllIP= ip

    end function

     

     

    function GetAllMask

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    Set IPConfigSet = objWMIService.ExecQuery _

    ("Select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

    For Each IPConfig in IPConfigSet

    If Not IsNull(IPConfig.IPAddress) Then

    For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)

    mask = mask & IPConfig.SubnetMask(i) & VbCrLf

    Next

    End If

    Next

    GetAllMask= mask

    end function

     

    /Script

     

    Ich kann zwar die IP Adressen auslesen aber bei der Subnet Mask bekomme ich immer folgenden fehler: Das Object unterstützt diese Eigenschaft oder Methode nicht.: 'IPConfig.SubnetMask' In Allip.vbs(GetAllMask) Line 28, column 12.

     

    kann mir irgend jemand hierbei helfen?

×
×
  • Neu erstellen...