Hello,

My 2003 server loses Internet connectivity frequently which I can get back
by ipconfig/release and ipconfig/renew. I am looking for a script to ping an
internet address and if it receives no reply to run ipconfig release and
renew. Preferably the script would check at regular intervals like every
hour, other wise I could schedule it with task scheduler.

Thanks for any help.

Re: script for ping and ipconfig by Robert

Robert
Tue Sep 13 08:03:03 CDT 2005

Hi,

so the first thing that came to my mind is following steps:

Execute by shell.Run a ping redirected to a file like this "ping
www.google.com > C:\temp\pingresult.dat"
After retruning open the file with fso parse the lines searching for a
string that only comes when the ping didn't work!
Then you can execute ipconfig /release an so on by also using shell.run!

Regards,

Rob

"Greg O" <none@none.atall> schrieb im Newsbeitrag
news:432644a1$0$17734$afc38c87@news.optusnet.com.au...
> Hello,
>
> My 2003 server loses Internet connectivity frequently which I can get back
> by ipconfig/release and ipconfig/renew. I am looking for a script to ping
an
> internet address and if it receives no reply to run ipconfig release and
> renew. Preferably the script would check at regular intervals like every
> hour, other wise I could schedule it with task scheduler.
>
> Thanks for any help.
>
>



Re: script for ping and ipconfig by Jonathan

Jonathan
Tue Sep 13 11:55:12 CDT 2005

You can try and use teh WMI Win32_PingStatus Class.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_pingstatus.asp

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Greg O" <none@none.atall> wrote in message
news:432644a1$0$17734$afc38c87@news.optusnet.com.au...
> Hello,
>
> My 2003 server loses Internet connectivity frequently which I can get back
> by ipconfig/release and ipconfig/renew. I am looking for a script to ping
> an internet address and if it receives no reply to run ipconfig release
> and renew. Preferably the script would check at regular intervals like
> every hour, other wise I could schedule it with task scheduler.
>
> Thanks for any help.
>



Re: script for ping and ipconfig by Greg

Greg
Tue Sep 13 22:24:06 CDT 2005


"Robert Baur" <robert.baur@[remthis]cim-team.de> wrote in message
news:dg6g92$2rk$1@lx-news.CIM-Team.de...
> Hi,
>
> so the first thing that came to my mind is following steps:
>
> Execute by shell.Run a ping redirected to a file like this "ping
> www.google.com > C:\temp\pingresult.dat"
> After retruning open the file with fso parse the lines searching for a
> string that only comes when the ping didn't work!
> Then you can execute ipconfig /release an so on by also using shell.run!
>
> Regards,
>
> Rob
>

I don't know enough about scripting to write one myself though. The problem
is the Internet drops out regularly from a cable modem. I worked out a
possible solution with Performance Monitor in 2003 server by monitoring the
Bytes per second output on a network card. I can set it so if it drops below
1 packet per second then it does several actions. One is it restarts a log
so I can already see when it stops. Another is it posts a notice to Even
Viewer. A third is it can run something like a bat file.

So if I can get a bat file that release and renews with ipconfig that might
fix it. I found a few of these that work when I click on them, but the
Performance Monitor can't start them. Also I tried task scheduler to maybe
run it every hour but it couldn't start them either.

For example if I just put in a bat file:

ipconfig /release
ipconfig /renew

and I click on that it will renew the IP address and fixes the problem.
Neither task scheduler or Performance monitor will start this bat though.

The ping program would be a good solution too but I don't know how to
complete the suggestions.



Re: script for ping and ipconfig by Greg

Greg
Tue Sep 13 22:24:36 CDT 2005


"Jonathan Liu [MSFT]" <jonliu@online.microsoft.com> wrote in message
news:ea6ipPIuFHA.3568@TK2MSFTNGP10.phx.gbl...
> You can try and use teh WMI Win32_PingStatus Class.
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_pingstatus.asp
>

Please see the reply to the other thread.