Solved

Network cards

Posted on 2004-08-09
9
719 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
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Azure Backup Locations 2 45
I could not build boost code, 10 79
Arduino EDI - Programming language 3 80
C++ :Change value from  DisableCMD registry 4 51
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now