2
I am trying to identify a specific network adapter connected to the Internal vSwitch, so I can subsequently bind the DHCP server role to that adapter. There are 3 Network Adapters, 2 connected to External (connected to my laptops Wifi & Ethernet adapter) vSwitches, and 1 to Internal (shared only between VM's). However they are not easily identified from within the VM.
Name InterfaceDescription ifIndex Status MacAddress LinkSpeed
---- -------------------- ------- ------ ---------- ---------
Ethernet 2 Microsoft Hyper-V Network Adapter #2 6 Up 00-15-5D-01-64-16 270 Mbps
Ethernet 3 Microsoft Hyper-V Network Adapter #3 4 Up 00-15-5D-01-64-17 10 Gbps
Ethernet Microsoft Hyper-V Network Adapter 5 Disconnected 00-15-5D-01-64-15 10 Gbps
The state of either external adapter can be connected or not, but usually 1 is (Wifi most likely). In above example its probably the "Ethernet 3" adapter, but thats only because my Ethernet isn't connected. It will have to work in a PowerShell script (PSSession). The VM is running Server 2016. How to identify the internal adapter to bind DHCP to?
Thanks a lot!
Edit: I could also wait with creating the internal network adapter until ready to bind dhcp to it and store the previously existing adapters first before creating the internal adapter.