Looking for a way to determine wich Network adapters are truly Wired ethernet.

I'm Working on a little app that is going to validate that the machine is connected to a wired network before we allow it to start a re-installation of the operating system. Our wireless net works great for installed systems (they do have a machine certificate)
but we cannot install on it (since the machine must be domain joined to get that cert)
So far I have not found any method that truly tells if the card is a wired network adapter. 
Win32_NetworkAdapter:s AdapterTypeID does not work since many wireless adapters report type=0 wich should be wired adapters. 
MSNdis_PhysicalMediumType does not work. It returns undefined for a number of adapters
Many posts on the net talks about detecting the connection state wich doesn't work either since it will return the same value for a connected wired adapter and a connected wireless adapter
Other posts suggests using powershell and looking at tha dapter name. That doesn't work if you
got to support a number of languages and what happends if a user renames the interface?
The only way I can make it sort of work is to pipe the output from netsh LAN show interfaces and then do queries on those adapters but I would prefer a soloution in Code. 
Since Netsh can do it, there must be a way to do this

The reason for the C code not running under WinPE was user error ........
Forgot to link it static.
I have been digging around some more and so far the only API that will give us the correct and complete picture seems to be GetIfEntry2, however I can't find dotnet code for it. 
It seems like most other methods uses the older GetIfEntry under the hood and that will not give us the true data since many types will report as NDisPhysicalMediumType 0. 
However a combination of Win32_network adapter and MSNdis_PhysicalMediumType actually seems to work.
Win32_network filtered on AdapterType='Ethernet 802.3' gives us everything that claims to be an ethernetadapter. That list will however include wireless, bluetooth and some virtual adapters. 
MSNdis_PhysicalMediumType filtered on NDisPhysicalMediumType 0 does not show Wireless or Bluetooth but will instead show isatap interfaces and so on. 
The Key was to "join" these two on win32_networkadapter.Name to MSNdis_PhysicalMediumType.Instancename giving us the possibility to filter out the unwanted adapters using both methods. 
I have made a demoscript that became embarrassing short 
'* ListPhysicalAdapters.vbs
'* Purpose : A script to list the true Physical Ethernet adapers.
'* Created : 2005-02-17
Dim colItems_Win32_NetworkAdapter, Colitems_MSNdis_PhysicalMediumType
Dim objNetworkAdapter,objPhysicalMediumType
' Select the adapters that claims to be 802.3 aka ethernet adapters. This will hoverver get anything calling itself an Ethernet adapter
Set colItems_Win32_NetworkAdapter = GetObject("winmgmts:\\.\root\cimv2").ExecQuery("Select * from Win32_NetworkAdapter where AdapterType='Ethernet 802.3'",,48)
For Each objNetworkAdapter in colItems_Win32_NetworkAdapter
  ' Select the adapters that claimed to be Ethernet Adapters above and filter out the ones who doesn't have an Ethernet Connector (type=0 is used for fallback/undefined)
  Set Colitems_MSNdis_PhysicalMediumType = GetObject("winmgmts:\\.\root\WMI").ExecQuery("SELECT * FROM MSNdis_PhysicalMediumType where InstanceName='" & objNetworkAdapter.Name & "' AND (NdisPhysicalMediumType=0 OR NdisPhysicalMediumType=14)",,0)
  For Each objPhysicalMediumType in Colitems_MSNdis_PhysicalMediumType
    Wscript.Echo "AdapterType: " & objNetworkAdapter.AdapterType & ""
    Wscript.Echo "MACAddress: " & objNetworkAdapter.MACAddress
    Wscript.Echo "Name: " & objNetworkAdapter.Name
    Wscript.Echo "PhysicalMediumType: " & objPhysicalMediumType.NdisPhysicalMediumType
Wscript.Echo ""
  next
Next

Similar Messages

  • We are currently looking for a way to link images to a design file within programs like InDesign and Illustrator using an HTML link instead of a local file.  We are hosting our images in SharePoint and need the design file to retain it's links, no matter

    We are currently looking for a way to link images to a design file within programs like InDesign and Illustrator using an HTML link instead of a local file.  We are hosting our images in SharePoint and need the design file to retain it's links, no matter who on our network opens the design file.

    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Looking for  a way to access iPod Library via Front Row

    I am looking for a way to browse my iPod library in Front while my iPod is connected to my computer.
    Does anyone know the trick?
    iMac Intel Duo Core   Mac OS X (10.4.4)   iPod

    All of my music is backed up on an external hard drive connected by FireWire to my desktop PC. I have enabled Share Music so that when I open iTunes on my iMac, I am able to access all the music on my external hard drive wirelessly. If I highlight the shared music in the Source column and then turn on Front Row, I have access to all the music on my external hard drive (wirelessly) through the remote control. I would imagine that since the iPod appears in the Source column when it's properly docked, you should have access to it through Front Row.
    I don't know if this will help, but good luck!
    iMac Intel Core Duo   Mac OS X (10.4.5)   Wireless network with Dell desktop, HP laptop, Airport Express, iPod

  • Looking for a way to broadcast a line in to the Airpot Express?

    Looking for a way to run line input into my macbook and broadcast it to the Airport Express to Play on my Stereo..

    It is discussed on the xfce forums but unfortunately that solution requires editing by hand. However it does seem relatively easy to automate. Writing a graphical program for those tasks is something you'd only have to do once.

  • Looking for a way to get built in audio to be heard out of AirTunes

    Looking for a way to get built in audio to be heard out of AirTunes, not just iTunes.

    thanks for the post, i downloaded that app but like i read, its really a worthless piece of junk, the 2 second delay yet alone i did not succeed to send my iChat audio to my airTunes speakers.

  • Looking for a way to Export Still Image to iPhoto

    Hi I'm looking for a way to export a still image from iMovie 08 to iPhoto 08? The simple drag, help, web search etc doesn't seem to come up with an answer but it's been a long day.
    Thanks

    Find the still within an event clip, right mouse, select add still frame to project. Repeat for all the stills you want.
    In Finder under pictures, you should find files for all the stills you created. Import them into Iphoto and there you have it.
    There is probably an easier way but this is not too bad.

  • Hola a todos , busco una manera de crear un pdf desde la impresora de ios, como lo puedo resolver, gracias. Hi all, I look for a way to create a PDF from the printer ios, as I can solve, thanks

    Hi all, I look for a way to create a PDF from the printer ios, as I can solve, thanks

    Try this process on your Mac. These files will be regenerated by Mac OS X with default settings.
    1. Quit the Mac App Store
    2. Trash the following folders and files; (~ is your Home folder)
    ~/Library/Caches/com.apple.appstore
    ~/Library/Caches/com.apple.storeagent
    ~/Library/Cookies/com.apple.appstore.plist
    ~/Library/Preferences/com.apple.appstore.plist
    ~/Library/Preferences/com.apple.storeagent.plist
    ~/Library/Preferences/com.apple.streagent.plist.lockfile
    Mac HD/Library/Preferences/SystemConfiguration/networkinterfaces.plist
    3. Restart your Mac
    4. Open the Mac App Store
    5. Log into your MAS account

  • Looking for a way to switch views using Javascript

    Hi ! I'm currently studying Acrobat 3D. <br /><br />I've got a PDF document with a 3D Annotation, which was imported from a U3D file. I defined 3 views : "initial", "front" and "top".<br /><br />My problem is that I'm looking for a way to switch views using Javascript. <br /><br />In fact, when I list cameras using the following code, I only get one camera called "DefaultView". So my question is : where has my "initial", "front" and "top" views been ? Is there a way I can switch between them using Javascript ?<br /><br />for(i=1;i<scene.cameras.count;++i)<br />     {<br />          Cam = scene.cameras.getByIndex(i);<br />          <br />          console.println("camera " + i + " : " + Cam.name);<br />     }<br /><br />Thank you very much in advance.<br /><br />françois

    Are the dates on these entries correct??!! Doesn't seem like it. Anyway, just in case, here's some code to help:
    //=========================================================
    backgrounder = new RenderEventHandler();
    backgrounder.onEvent = function(event)
    runtime.removeEventHandler(this);
    canvas = event.canvas;
    background = canvas.background;
    keyer = new KeyEventHandler();
    keyer.onEvent = function(event)
    switch (event.characterCode)
    case 49:
    cam = scene.cameras.getByIndex( 0 );
    canvas.setCamera( cam );
    break;
    case 50:
    cam = scene.cameras.getByIndex( 2 );
    canvas.setCamera( cam );
    break;
    case 51:
    cam = scene.cameras.getByIndex( 3 );
    canvas.setCamera( cam );
    break;
    runtime.addEventHandler( keyer );
    runtime.addEventHandler(backgrounder);
    //inform user
    console.println("Use the 1,2,3 Keys to toggle between cameras");
    //===============================================

  • I am looking for a way or a PDF annotator app to use in a tablet that don't allow deletion as I edit.

    Hi All, I am looking for a way or a PDF annotator app to use in a tablet that don't allow deletion as I edit. I need to use in a controlled process that don't allow user to delete or erase edits once a mistake is made or a rewrite is needed. Thank you

    See How to call Adobe Acrobat 9 APIs to OCR the PDFs through .NET reply 4.

  • I am looking for a way to convert Microsoft Office files to my apple and back again

    I am looking for a way to convert Microsoft Office files to my apple and vise vera.
    <Re-Titled By Host>

    you are asking about Microsoft products and using a laptop, not a workstation Mac Pro.
    The Numbers and Pages Apple Communities. or MS Community if you want those.
    Importing and Exporting, but Numbers and Pages will not do a SAVE into other formats by default, and therefore have to keep using Export which is messy.
    Changing your own thread midstream may not be ['thread hijack'] but it is like having the rug pulled out by changing the subject on us.

  • Looking for a way to export full Popularity Trends data

    Greetings!
    I'm looking for a way to access all "popularity trends" data for a SharePoint 2013 publishing site in one place. I'm probably missing something pretty basic here, (I hope), but it seems if I pull up popularity trends for the site, all I get is
    the hits & unique users for the site as a whole. If I go into my pages library and choose "Most Popular Items," I'm given a search results page that I can't run reports from. And if I select the "popularity trends" link under one of
    those search results, I get a usage report for a single, specific page.
    I've thought about doing a multi-select of pages from my site's Pages library, but I have more than 100 pages in the site, so I still can't get at everything all at once. Plus, the resulting usage.xlsx file just includes a lot of  reports on individual
    pages.
    There's got to be something more all-encompassing than this...right?
    Help!

    Hi,
    According to your post, my understanding is that you wanted to see the all popularity trends data for a site.
    Where did you export the usage report?
    Did you export the report from  Popularity and Search Reports?
    To view the Popularity Trends report for a site collection
    Verify that the user account that is performing this procedure is a member of the Owners group.
    In the site collection, on the Settings menu, click Site ettings.
    On the Site Settings page, in the Site Collection Administration section, click Popularity and Search      Reports.
    On the View Usage Reports page, in the Usage Reports section,  click Usage.
    In the message box, click Open to open the report in Excel, or  click Save or Save as to save the  report.
    Click the tabs to view the usage report for the different usage event types.
    http://technet.microsoft.com/en-us/library/jj715890(v=office.15).aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Looking for a way to create/edit a newsletter online, then be able to generate a customized PDF file

    I am looking for a way to be able to customize a newsletter online, then be able to export/generate a PDF file from that newsletter.
    Basically this is for a friend that is a real estate agent, and currently she is creating the newsletters in MS Publisher. I'm hoping to find a way to be able to allow her to login to a secure area of her webpage(that part isn't a problem) but then be able to create/customize a monthly newsletter that needs to be customizable.
    For example, the August Newsletter will be 2-sided, and most of the newsletter will be the same, but she needs to be able to have a newsletter for different apartment buildings so the customers can just go to their building link/area on the webpage and be able to download that month's custom PDF file that has a portion of the main newsletter that is a table/list of properties for that specific location.  The data will be stored in a database.
    After writing the above, I can probably create a front-end to the database so she can enter everything that way, but I still need a way for her to generate the customized PDFs after she is done with that month's data.
    I was hoping Adobe had something that could be used, or am I stuck using php or Javascript and just doing this with custom scripting?
    Anyone have any ideas?
    Thanks!
    John

    I was hoping Adobe had something that could be used, or am I stuck using php or Javascript and just doing this with custom scripting?
    I think you will have to do the latter.  While you are thinking about writing the PDF file, don't overlook fpdf (google it)....

  • Looking for a way to find out the x,y coordinates of a string inside a PDF

    Hi!
    I'm looking for a way to find out the x,y coordinates of a string inside a PDF (with free java api's only)
    I got a pdf, and a string to find inside it, what i need to do is to get this string x,y position inside that pdf....
    If any one knows of such, plz let me know...
    Thanx ahead
    Daniel.

    vedmack wrote:
    Hi!
    I'm looking for a way to find out the x,y coordinates of a string inside a PDF (with free java api's only)
    I got a pdf, and a string to find inside it, what i need to do is to get this string x,y position inside that pdf....
    If any one knows of such, plz let me know...
    Thanx ahead
    Daniel.AFAIK, a string of text does not have an (x,y) location inside a PDF file. The location is exists on your screen, and will differ whenever you adjust the resolution of it. Text can have a location when it's stored as an image though, but than it's really the location of a certain number of pixels (not necessarily a string!).

  • Looking for automated way to test print PnP printer after install then delete

    At times we test 20 to 30 printers in a day. I am looking for automated ways to increase the efficiency of this. I would like to simply have the printer install using PnP print a test page then delete itself after the test page or on removal. Are there any settings that can be changed on the computer to change the PnP process to make this possible. I am currently trying to learn and understand the Plug and play process so that I may find out how to get started. Any ideas would be greatly appreciated.
    Thanks
    This topic first appeared in the Spiceworks Community

    Chris
    I spent all day Googling and doing side by side comparisons of my old and new systems.
    My display is a Dell U2410. It has several presets, including sRGB and Adobe RGB. I've been using sRGB.
    On my OLD system, (Win XP, PsCS2, DwCS4) there seems to be no distinction between color managed and non color managed apps, even on this wide gamut display. I could capture (digital camera) in Adobe RGB, open and edit in PsCS2, save as .psd, convert to CMYK for print, or convert to sRGB for SFW. All images looked identical and they printed and displayed perfectly. I thought this was normal, and seemed logical. This also seems to be the source of my incorrect assumptions. I was trying to get my new machine to behave like my old one.
    So I get this new machine (Windows 7, PsCS5, DwCS5) and now (still in sRGB display mode) all color managed apps appear de-saturated. Non color managed apps are OK. If I switch the display to Adobe RGB, color managed apps are OK, but non color managed apps are way too saturated. From my investigation, I believe this is normal behavior on a wide gamut display. I've tried changing the Control Panel > Display > Screen Resolution > Advanced settings > Color Management options, but to no avail. Either I'm missing something, or Windows 7 is doing color management differently.
    It seems my only option now is to use Adobe RGB display setting for Ps, etc. and switch to sRGB for Dw and non color managed apps. Or, have 2 separate files for print and web. I've Googled 'til my eyes are numb and still not sure I'm getting this. Any enlightenment would be greatly appreciated.
    Finally, I don't see an edit function here, so I can't remove my previous incorrect reply. Moderator, please feel free to do so.
    Thanks

  • Looking for a way to programmatically set the visible portion of the front panel when a subVI opens

    I am looking for a way to programmatically set the visible portion of the front panel when a subVI opens.  Haven't found any posts that relate, but I'm not sure how to ask the right question.  To be clear, I want to write a helper VI to go through a list of subVIs to make sure the background images are all in the same place when their respective subVIs open.  I hate manually playing with scroll bars before I save each of the VIs...  I'm figuring I need to find the top/left location of the background image (know how to do this already) and then set a VI FP property to  these values or some offset, but I can't find the relevant property. FP:run-timeposition:custom looked promissing, but only affects the location of the window, not the area of the front panel the window is displaying.
    Solved!
    Go to Solution.

    Cool.  Getting closer.  The way I implemented your suggestion affects the subVI only if it is open.  I can use this to do what I'm after, perhaps putting the code into each subVI.  Maybe open all subs, run the helper, and save.    Seems like I'm missing the elegant version...
    My proof of concept code:

Maybe you are looking for