Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting remote network info (VB6 or VBA Office2003)

    Have some systems on our network with have fixed IP-addresses. Is it possible to use this address and remotely get to these systems and then collect additional info? I'd need the subnet-mask and gateway IP-addresses for each system. As there are >40, I hoped there might be an easy way (in VB but also existing programs might do)..

    Thanks!

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Getting remote network info (VB6 or VBA Office

    Hi Erik

    This link seems to be a very good VB reference would this be useful?

    http://vbnet.mvps.org/index.html?cod...ork/index.html
    Jerry

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting remote network info (VB6 or VBA Office

    Cool... thanks. I just scanned through all of them. With my (relatively) limited knowledge of networks however, I didn't seem to find exactly the call that returns network info from a remote system (other than DHCP servers). Am I right?

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Getting remote network info (VB6 or VBA Office

    If you know the host names involved, you can retrieve this info using VBScript as shown here. If you don't know the host names, you can use one of the API functions listed in the link Jerry gave you to retrieve them.
    HTH
    Regards,
    Rory

    Microsoft MVP - Excel

  5. #5
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting remote network info (VB6 or VBA Office

    OK, the host-name tool works and I am now able to enter an IP-address and get the host name back.

    Next, I fill this in in the script below (replacing HOSTNAME) and run it. Regretfully I'm getting empty dialog boxes, that is, nothing seems to be reported back...

    I must be still missing something here..

    Erik Jan



    On Error Resume Next

    strComputer = "HOSTNAME"
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!" & strComputer & "rootcimv2")
    Set colNicConfigs = objWMIService.ExecQuery _
    ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")

    WScript.Echo VbCrLf & "Computer Name: " & strComputer
    WScript.Echo " IP Addresses & Subnet Masks"

    For Each objNicConfig In colNicConfigs
    WScript.Echo VbCrLf & " Network Adapter " & objNicConfig.Index
    WScript.Echo " " & objNicConfig.Description & VbCrLf
    WScript.Echo " IP Address(es):"
    For Each strIPAddress In objNicConfig.IPAddress
    WScript.Echo " " & strIPAddress
    Next
    WScript.Echo " Subnet Mask(s):"
    For Each strIPSubnet In objNicConfig.IPSubnet
    WScript.Echo " " & strIPSubnet
    Next
    Next

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •