Scripting network adapter events

J

Joe Thompson

At work we have some XP laptop users who roam from site to site, most of
which need one DNS configuration and some of which need a separate one. I
wrote a script that successfully changes them based on the IP address when
it runs. Now I've been asked if I can make a script monitor the network
adapter and run the DNS routine when the adapter reconnects, because a lot
of these users don't shutdown and restart -- they suspend or hibernate
when moving from home to work and back.

I have info on how to register for a WMI adapter connect/disconnect event,
but I'm not actually sure that's the right way to proceed.

* Does a connect event fire off for connected adapters when Windows
resumes from hibernate/suspend, if the adapter was already connected
before Windows stopped?

* Is the overhead of having a script run in the background continuously
waiting for a WMI event negligible, acceptable or burdensome?

* If the proposed way to do it is wrong, what's the right way?

The method we're thinking of using is this:

http://groups.google.com/group/microsoft.public.scripting.wsh/msg/5ff1b602a90aefbe

(sorry for the long URL)

Many thanks to anyone who can offer advice. -- Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top