How would you determine the virtual network type (external or internal) from an hyper-v virtual host ? My goal is to activate DHCP for internal network and static ip for external network.
Activating or disabling dhcp from powershell is not a problem like shown on the scripting guy blog


problem solved with a really simple solution : try to ping an external host

if( (test-connection -quiet <external_IP_address>) -eq $false){
    #private network, allow DHCP
    #set static ip address

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.