Insider Preview Disable or Enable Ethernet Adapter in Network Connections Dialog..

Discussion in 'Windows 10 Help and Support' started by Saltgrass, Mar 19, 2015.

  1. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    Well if that makes sense to you then you're a better man than me Charlie Brown.
    I did finally find the powershell commands that will actually work and at least make some sense to me.
    Those separators that look kinda like backslashes are actual the "pipe" symbol. On my keyboard it's SHIFT + \

    SOURCE: http://blogs.technet.com/b/askpfeplat/archive/2013/03/29/mailbag-how-do-you-set-network-adapter-settings-with-powershell-in-windows-8-or-windows-server-2012.aspx
     
  2. Saltgrass

    Saltgrass Excellent Member
    Microsoft Community Contributor

    Joined:
    Oct 16, 2009
    Messages:
    15,157
    Likes Received:
    393
    The good news about this is the situation is temporary. The Microsoft person says it will be corrected by the RTM. If we have many more builds, hopefully it will be corrected prior to that. Good thing it doesn't really effect me right now.

    I will have to do some testing. I don't yet understand how the placeholder pipes into the commands since the index is the only thing really used in the New-NetIPAddress. Something for me to do later today.. :)

     
  3. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    I'm pretty sure, but not positive you can use, either the adapter's index number or, the adapter's "alias" . "Ethernet" in my case.
     
  4. Saltgrass

    Saltgrass Excellent Member
    Microsoft Community Contributor

    Joined:
    Oct 16, 2009
    Messages:
    15,157
    Likes Received:
    393
    I have been doing some testing and have noticed some things.

    The New-NetIPAddress command will disable the DHCP.

    The first time I ran the command, it seemed to remove the IPv4 DNS address. On subsequent attempts it did not.

    I get an error message saying the Default Gateway is already present, so that part of the command may not be necessary, but I am not trying to change that address.

    When you use -InterfaceAlias, will it always be Ethernet, or might there be another designation? What happens if you have two Ethernet adapters, such as on an ASUS X99-Deluxe motherboard. Would it not be advisable to use the Interface Index to make sure you have the correct adapter? I can't test this since I don't have the dual Ethernet Adapters on this board. But it would seem to be necessary to discern the designation, index or alias, of the targeted adapter.

    Edit: I wanted to check what was being stored in $NetAdapter and got the following"

     
    #24 Saltgrass, Apr 2, 2015
    Last edited: Apr 2, 2015
  5. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    If you use the Get-NetAdapter command without any reference to a specific adapter it should display the names ("Alias") of all adapters present on the system.
    Armed with that information then you should be able to perform other commands on a specific adapter based on its' name.
    As shown on the link I posted above.

     
  6. Saltgrass

    Saltgrass Excellent Member
    Microsoft Community Contributor

    Joined:
    Oct 16, 2009
    Messages:
    15,157
    Likes Received:
    393
    Ok, you do not need the second command, it is accomplished by the last command.

    If you already know the Alias or Index, you don't need to port ( | ) anything and you don't need to use $netadapter at all. It still appears, and I may not be outputting the contents of $netadapter correctly, that it does not contain either the Alias or Index of the adapters. The output of the command itself does.

    The need for the DNS command is still in limbo. More testing might help decide the need for it.

    I have been doing some reading on the net about Powershell also. I have been trying to pay strict attention to the date of the information. I have a book I will check and see if I can find any specific information about these commands. I need to learn about Porting, so I will probably see it in one of those sections.

    I can use the two command lines, get-NetAdapter and new-NetIPAddress, and achieve the static IP address for the adapter. But following the procedure I am still seeing the Default Gateway address disappear, in some cases, so it looks some more trials to make certain which commands will get the job done.

    Edit: I suppose I should really try it in Windows 10... ;)
     
  7. Saltgrass

    Saltgrass Excellent Member
    Microsoft Community Contributor

    Joined:
    Oct 16, 2009
    Messages:
    15,157
    Likes Received:
    393
    More testing has revealed some more information. My problem with the Default Gateway is solved by disabling and enabling the Network Adapter, the Default Gateway address will return.

    It also seems to be necessary to know what is wrong with a configuration before it can be repaired. If the DHCP server is not working or the network is being seen as Unknown, the situation will be different from someone who just wants to change their IP address.

    If nothing else comes from this, I have gotten more experience with PowerShell and have a better understanding of how it works.
     

Share This Page

Loading...