?
Solved

Network cards

Posted on 2004-08-09
9
Medium Priority
?
728 Views
Last Modified: 2013-11-15
I have been asked by my company to write something that will detect if certain processes are running on a machine ( Job Done )  - the next task was to remove the computer from the network if certain processes weren’t running. Here is my dilemma - I posed a question the other day asking how to force a computer to go into Hibernate ( after a little work I got it working See : http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_21084465.html). But I didn’t like killing a computer incase it was mission critical.

I managed to convince the network people that:
A - Not all the computers on the network will support Hibernate ( window 98, NT 4 etc.)
B - Developers will get P*ssed if I shutdown the machine (even if I hibernate the state of the machine) - because I know I would be P*ssed
C - Build / Integration people may be doing a build of a product i.e. cost the company a lot of money if I kill that half way

I need a method to enumerate all network cards on the machine and disable them, keeping the machine on and working (locally at lest) but it’s better than killing the machine until I.T. get a chance to look at it.

Thanks in advance for you input.

P.S. We do have Linux and Unix Machines on the network but these will not be affected by this tool, so feel free to make suggestions windows specific, but please keep in mind that everything as far back as win98 will have be considered
0
Comment
Question by:ice_nin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
9 Comments
 
LVL 22

Expert Comment

by:grg99
ID: 11757330
If you have "netsh" on the computers, you can issue "netsh interface show interface" and "netsh interface delete interface xxxx"  commands.

0
 
LVL 22

Expert Comment

by:grg99
ID: 11757453
You could also do "ipconfig /release xxxx".

0
 

Author Comment

by:ice_nin
ID: 11758226
Firstly i would have to have a list of the interfaces i wanted to release in either of the suggested methods (?). How easy is it to obtain a list of all network devices on the machine in code?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:grg99
ID: 11758702
>How easy is it to obtain a list of all network devices on the machine in code?

"netsh interface show interface"
0
 
LVL 14

Accepted Solution

by:
wayside earned 500 total points
ID: 11774060
If you want to do this programatically you can do it using the INet* COM interfaces such as INetCfg, IEnumNetCfgComponent, INetCfgBindingPath, IEnumNetCfgBindingPath, INetCfgComponent, INetCfgBindingInterface, and IEnumNetCfgBindingInterface.

There's a program with source in the DDK called "Bindview", which uses these interfaces to walk all of the network services and enumerate all of the bindings for each service. You can then check their status and enable/disable them. You can see how to use the COM interfaces by examining the source code, I found the docs on these to not be very good.

Taking a sledgehammer approach such as deleting all the interfaces may not be ideal, as you will eventually want to restore this system to the network. Doing an "ipconfig /release" is trivially undoable once a user realizes he's been disconnected, it doesn't seem like a rigorous solution.
0
 
LVL 22

Assisted Solution

by:grg99
grg99 earned 500 total points
ID: 11774599
There's no easy and thogough solution for this..  My lame "ipconfig /release" is only going to shut down TCP binding, not any other installed protocols.  Now you could argue that the other protocols like NetBuei and NetBIOS shouldnt be running anymore, so they're not a big problem.

I'd probably just have the program send a message to some flunky whose job is to go to that computer and pull the network cable.

  Or if you have semi-intelligent network hubs, write a program to disable the network cable from the hub end.  Yep, that's the ticket!



0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you looking to recover an email message or a contact you just deleted mistakenly? Or you are searching for a contact that you erased from your MS Outlook ‘Contacts’ folder and now realized that it was important.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question