Catching error message from ping

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • airwot4

    #1

    Catching error message from ping

    I've been using ADSI to lookup a complete hostname from active
    directory from a partial as part of a script.

    It goes something like:

    Retrieve partial hostname from excel spreadsheet - authenticate this
    to a full hostname from active directory - ping the host to
    determine if it is reachable - if reachable perform a task.

    The difficult is at the ping stage, some of the hostnames on active
    directory do not seem to be able to resolve to I.P addresses. This
    does not result in a ping succeeding or failing but merely an error,
    how do I catch this error?

    I am using My.Computer.Net work.Ping to perform the ping operation.

  • rowe_newsgroups

    #2
    Re: Catching error message from ping

    On Jul 4, 7:51 am, airwot4 <neale...@gmail .comwrote:
    I've been using ADSI to lookup a complete hostname from active
    directory from a partial as part of a script.
    >
    It goes something like:
    >
    Retrieve partial hostname from excel spreadsheet - authenticate this
    to a full hostname from active directory - ping the host to
    determine if it is reachable - if reachable perform a task.
    >
    The difficult is at the ping stage, some of the hostnames on active
    directory do not seem to be able to resolve to I.P addresses. This
    does not result in a ping succeeding or failing but merely an error,
    how do I catch this error?
    >
    I am using My.Computer.Net work.Ping to perform the ping operation.
    Won't the standard try...catch block handle the exception?

    Thanks,

    Seth Rowe

    Comment

    • AlexS

      #3
      Re: Catching error message from ping

      Dump ping results into file and analyze file after ping completes.


      "rowe_newsgroup s" <rowe_email@yah oo.comwrote in message
      news:1183558148 .802407.102090@ r34g2000hsd.goo glegroups.com.. .
      On Jul 4, 7:51 am, airwot4 <neale...@gmail .comwrote:
      >I've been using ADSI to lookup a complete hostname from active
      >directory from a partial as part of a script.
      >>
      >It goes something like:
      >>
      >Retrieve partial hostname from excel spreadsheet - authenticate this
      >to a full hostname from active directory - ping the host to
      >determine if it is reachable - if reachable perform a task.
      >>
      >The difficult is at the ping stage, some of the hostnames on active
      >directory do not seem to be able to resolve to I.P addresses. This
      >does not result in a ping succeeding or failing but merely an error,
      >how do I catch this error?
      >>
      >I am using My.Computer.Net work.Ping to perform the ping operation.
      >
      Won't the standard try...catch block handle the exception?
      >
      Thanks,
      >
      Seth Rowe
      >

      Comment

      Working...