Script to find disable 2nd active net adapter

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 13 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
simanta
Posts: 2
Last visit: Sat Jun 27, 2009 4:24 am

Script to find disable 2nd active net adapter

Post by simanta »



Normal
0




false
false
false

EN-US
X-NONE
X-NONE













MicrosoftInternetExplorer4





























































































































































/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}





hi,

In my company I have to manage a network which comprises
both wired and wireless network. Recently I have observed that despite of our repetitive
instruction, some of my user connect his/her PC's both the network adapter
(wired/wireless)to the company network. This creates problem in my network
traffic as well as in the DNS server. Now I am looking for a script which will
run with the login script and it will look for the active network adapters in
the users PC. Now when it detect both the adapter active, it will give a
message and disable one adapter randomly.
I am not an expert in Kixtart sripting and don't have idea how to do this. This
will be a great help for me if anybody provide me such a script or idea how to
do so.

Thanks in advance to all who help in this.
User avatar
simanta
Posts: 2
Last visit: Sat Jun 27, 2009 4:24 am

Script to find disable 2nd active net adapter

Post by simanta »



Normal
0




false
false
false

EN-US
X-NONE
X-NONE













MicrosoftInternetExplorer4





























































































































































/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin-top:0in;
mso-para-margin-right:0in;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0in;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}





hi,

In my company I have to manage a network which comprises
both wired and wireless network. Recently I have observed that despite of our repetitive
instruction, some of my user connect his/her PC's both the network adapter
(wired/wireless)to the company network. This creates problem in my network
traffic as well as in the DNS server. Now I am looking for a script which will
run with the login script and it will look for the active network adapters in
the users PC. Now when it detect both the adapter active, it will give a
message and disable one adapter randomly.
I am not an expert in Kixtart sripting and don't have idea how to do this. This
will be a great help for me if anybody provide me such a script or idea how to
do so.

Thanks in advance to all who help in this.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Script to find disable 2nd active net adapter

Post by jvierra »

There is a Group Policy setting which controls this. There is a
wireless" policy that will not allow wireless connections when connected to the corporate network. This is far more reliable and easier to manage than trying to discover the adapter in a script.
jvierra2009-06-27 21:16:17
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Script to find disable 2nd active net adapter

Post by jvierra »

Have you tried settting GPO to disable wireless by location. When location is desktop LAN connection then disable wireless else enable wireless for other locations.


If you stil lwant to try it the hard way then use WMI Wn32_NetworkAdapter. You can enable or disable each adapter that you need to control.

jvierra2009-06-27 22:14:28
User avatar
jane barnes
Posts: 1
Last visit: Thu Nov 11, 2010 9:55 am

Script to find disable 2nd active net adapter

Post by jane barnes »

Hi Guys,

Is it possible to create a batch file containing a script that will prevent users from renaming files on the hard drive particularly programs. Surfing the net is rampant in our production area and one way to access the net is by renaming Mozilla Firefox to notepad.exe. On the GPO perspective, notepad and some applications are considered business tools so we can't disable them. My problem is that standard users are able to rename downloaded files so they can run them. I have tried the hash method but so far nothing works. Help please..

Jane Barnes
Vita Mix Blenders | Vitamix Recipes | Vita mix 5200 reviews
This topic is 13 years and 4 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked