This adventure of configuring the network adapter started when I required admin rights to modify the settings because UAC (User Access Control) was disabled which prevented the prompting of admin privilege. The challenge was that I did not want to log off or switch user account hence I had to resort to using elevated privilege for the command prompt and utilize the network shell.
To get a list of the names of network adapter, the following command was used:
netsh interface show interface
To get the IP address assigned to the network adapter:
netsh interface ipv4 show addresses
To enable/disable the network adapter:
netsh interface set interface name=”NameOfInterface” admin=[ENABLED/DISABLED]
To set dynamic IP address assignment for network adapter:
netsh interface ipv4 set address source=dhcp
To set static IP address for network adapter:
netsh interface ipv4 set address static 10.0.0.9 255.255.255.0 10.0.0.1
To set DNS IP address for network adapter:
netsh interface ipv4 set dnsservers source=dhcp
Or
netsh interface ipv4 set dnsservers static 10.0.0.10 primary
For WLAN network adapter:
netsh wlan show interfaces
Show the Wireless networks broadcasting:
netsh wlan show networks
Show the WLAN profiles on computer:
netsh wlan show profiles
Connect to one of the WLAN profile configured on computer:
netsh wlan connect name=[ProfileName]
Disconnect from the currently connected WLAN SSID
network wlan disconnect name=[InterfaceName]
For more commands and help on this topic, you can visit the Microsoft documentation site here.