Solved

Network cards

Posted on 2004-08-09
9
727 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
Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

 
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 125 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 125 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
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 viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

691 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