jguinch Posted June 28, 2017 Author Share Posted June 28, 2017 @benched42 : thanks to use my UDF. You're right, _GetNetworkAdapterInfos() does not return the same list of adapters than _GetNetworkAdapterList() , because one uses WMI and the other one uses the registry. To make sense, it should return the same list of adapters, I agree. So, I just edited the UDF (download link), so it returns the same list of adapters. Can you try it please ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
benched42 Posted June 29, 2017 Share Posted June 29, 2017 That did it. Thank you for a very useful UDF. Who lied and told you life would EVER be fair? Link to comment Share on other sites More sharing options...
TrunghieuTH10 Posted July 2, 2017 Share Posted July 2, 2017 I want to Bridge Network connections. Please help me! Link to comment Share on other sites More sharing options...
Developers Jos Posted July 2, 2017 Developers Share Posted July 2, 2017 @TrunghieuTH10, Meaning what exactly? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
jguinch Posted July 2, 2017 Author Share Posted July 2, 2017 I have no idea about how to do it using AutoIt (without using any external tool). I found this article which refers to bridgeutil.exe . It seems this tool could help you to do what you want. @Jos : https://www.windowscentral.com/how-set-and-manage-network-bridge-connection-windows-10 TrunghieuTH10 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
TrunghieuTH10 Posted July 3, 2017 Share Posted July 3, 2017 @jguinch Thanks! I will try it. Link to comment Share on other sites More sharing options...
antonioj84 Posted October 15, 2017 Share Posted October 15, 2017 (edited) I finally get to use your UDF. I am using Windows 10, I changed ' Local Area Network' to 'Ethernet', however I am still not able to display the DNS and WINS IP Edited October 15, 2017 by antonioj84 Link to comment Share on other sites More sharing options...
antonioj84 Posted October 15, 2017 Share Posted October 15, 2017 Correction, UDF works like a charm. You have to use the current adapter. not both at the same time. I was using my wireless adapter as default, once I close wireless and defaulted to Ethernet everything work including DNS and WINS Link to comment Share on other sites More sharing options...
Biatu Posted January 5, 2018 Share Posted January 5, 2018 (edited) How would one detect if a network interface is "Identifying..." or IPv4/IPv6: "No Network Access," "No Internet Access", "Internet" perferrably without wmi Edited January 5, 2018 by Biatu What is what? What is what. Link to comment Share on other sites More sharing options...
antonioj84 Posted April 4, 2018 Share Posted April 4, 2018 (edited) About adding something to change network type from public to private ? that will make your UDf awesome. Edited April 4, 2018 by antonioj84 update Link to comment Share on other sites More sharing options...
Tats Posted April 6, 2018 Share Posted April 6, 2018 It doesn't work on me using WinXP SP2. Was it supported? Link to comment Share on other sites More sharing options...
jguinch Posted April 6, 2018 Author Share Posted April 6, 2018 @Tats : for me, yes, but I did not try with XP SP2 (only SP3). Please, post your code and explain what you're trying to do Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
BenfnJovi Posted February 27, 2019 Share Posted February 27, 2019 (edited) @jguinch I am having an issue with this UDF. Not sure if it is a bug or what. I used the _GetNetworkAdapterInfos() to see which adapters are available and which adapter(s) are connected. The machines I am currently working with, has two ethernet nics, with identical Windows 10 images. Each machine shows "Ethernet 2" and "Ethernet 3" in the "Network adapters" section of the control panel. The _GetNetworkAdapterInfos() function performs correctly and retrieves the necessary information I need to determine which adapter I want to assign a static IP to. In the case of this deployment, I have 200 machines that I want to assign a static IP to, based on a numerical portion of the computer name. The issue I'm having is when I use the functions _EnableStatic and _SetGateways. No matter which nic I pass, it assigns the static to "Ethernet 2". I've tried using the info returned from _GetNetworkAdapterInfos() in [n][8], and I've tried passing "Ethernet 3" as a string, and it still assigns it to "Ethernet 2". expandcollapse popup#include <Network.au3> local $isConnected, $availableNics, $ClientID $ClientID= StringTrimLeft(@ComputerName, 3) if $ClientID<100 then $ClientID= StringTrimLeft(@ComputerName, 4) if $ClientID<10 then $ClientID= StringTrimLeft(@ComputerName, 5) $availableNics= _GetNetworkAdapterInfos() $t=UBound($availableNics, 1) $n=0 Do If $availableNics[$n][9]=2 Then $isConnected=$availableNics[$n][8] ExitLoop Else ;I did this in case there was already a static, within the same subnet, assigned to a nic that wasnt connected so that ;it would not error when assigning a static to the connected nic, which appears not to work at all, even when ran seperately ;in a seperate script designed to set all nics as dynamic, ahead of running the static assignement script. _EnableDHCP($availableNics[$n][8]) _EnableDHCP_DNS($availableNics[$n][8]) EndIf $n=$n+1 Until $n=$t-1 ;This MsgBox displays the appropriate nic that should be affected MsgBox(0,"192.168.100." & $ClientID & " Adapter: " & $isConnected, "",10) _EnableStatic($isConnected, "192.168.100." & $ClientID, "255.255.255.0") _SetGateways($isConnected, "192.168.100.100") shutdown(2) Edited March 6, 2019 by BenfnJovi Link to comment Share on other sites More sharing options...
spudw2k Posted February 28, 2019 Share Posted February 28, 2019 Nothing jumping out at me in regards to why the _EnableStatic and _SetGateway functions are working. Are you positive the IP and network names are valid? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
jguinch Posted February 28, 2019 Author Share Posted February 28, 2019 Please, can you try this code : #RequireAdmin #Include "Network.au3" _EnableStatic("Ethernet 2", "192.168.100.252", "255.255.255.0") _EnableStatic("Ethernet 3", "192.168.100.253", "255.255.255.0") and then, confirm that you have just one adapter with the good ip address Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
BenfnJovi Posted March 5, 2019 Share Posted March 5, 2019 @jguinch... I apologize about just getting back to you on this. I had to finish that deployment, by setting the statics manually and have been busy with other things since. I still have a need to get this working properly for future deployments. I ran your script, as you requested and get the same results. "Ethernet 2" was assigned with ".253" and "Ethernet 3" was unaffected... Any other suggestions? Link to comment Share on other sites More sharing options...
BenfnJovi Posted March 6, 2019 Share Posted March 6, 2019 On 2/27/2019 at 11:01 PM, spudw2k said: Nothing jumping out at me in regards to why the _EnableStatic and _SetGateway functions are working. Are you positive the IP and network names are valid? @spudw2k Positive the IP's are valid. I have full control over the network. I installed the dhcp server service, and configured all things related to the LAN. At the time of my first post, I only had 64 clients receiving IP's above .100, so everything below .100 would've been valid... If it weren't, it wouldn't have assigned the intended IP to "Ehternet 2", wouldn't you think? Windows will warn if you are using a gateway entry already in use by another nic, even on an inactive nic, and a warning dialog, requiring user confirmation, appears. To answer your second question, I'm not using the network names, I'm using the windows name assigned to each card...ie: "Ethernet 2", "Ethernet 3". Link to comment Share on other sites More sharing options...
spudw2k Posted March 8, 2019 Share Posted March 8, 2019 (edited) Just wanted to confirm. Your parsing of the hostname was the only thing I could see as possibly causing an IP format issue, but without seeing the hostnames or examples I was left to speculate. If you're good, then...you're good. Maybe you could result to using netsh instead an automating it that way, if there is indeed something inherent and unidentified in the UDF causing issues. Edited March 8, 2019 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
spudw2k Posted March 8, 2019 Share Posted March 8, 2019 (edited) What return code do you get from _EnableStatic Edited March 8, 2019 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
n3wbie Posted February 26, 2022 Share Posted February 26, 2022 Local $colNetAdapter = $objWMIService.ExecQuery($sQueryNetAdapter, "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) Local $colNetAdapter = $objWMIService.ExecQuery($sQueryNetAdapter, "WQL", ^ ERROR Can someone help me with this? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now