Configure Network Cards for your Windows Server 2012 or Hyper-V 2012 server

In order to manage the network card via PowerShell you need to use the NetAdapter and NetTCPIP modules.

Import Modules

  1. Open a PowerShell Window
  2. Import the module: Import-Module NetAdapter

Report of Ethernet Cards    

To create a simple report of the current Network Cards type the following command in your PowerShell Window.

get-netadapter | Select-Object Name, InterfaceDescription | Where-Object {$_.name -like “Ethernet*”} | sort

[hv01.server.net]: PS C:UserscvargasDocuments> get-netadapter | Select-Object Name, InterfaceDescription | Where-Object {$_.name -like “Ethernet*”} | sort

 

Name InterfaceDescription

—- ——————–

Ethernet 2 ASIX AX88178 USB2.0 to Gigabit Ethernet Adapter

Ethernet 3 ASIX AX88178 USB2.0 to Gigabit Ethernet Adapter #2

Ethernet 4 ASIX AX88178 USB2.0 to Gigabit Ethernet Adapter #3

Ethernet Intel(R) 82577LM Gigabit Network Connection

 

Rename Network Cards to match their assigned work

Now that you had a list of your network cards. Change their name to match the function they will perform.

[hv01.server.net]: PS C:UserscvargasDocuments> Rename-NetAdapter -Name “Ethernet” -NewName “Management”

[hv01.server.net]: PS C:UserscvargasDocuments> Rename-NetAdapter -Name “Ethernet 2” -NewName “Cluster”

[hv01.server.net]: PS C:UserscvargasDocuments> Rename-NetAdapter -Name “Ethernet 3” -NewName “VM”

[hv01.server.net]: PS C:UserscvargasDocuments> Rename-NetAdapter -Name “Ethernet 4” -NewName “ISCSI”

 

Configure IP Addresses for Network Cards

Now you can configure the IP Address for each of the network cards. You can use the sconfig.cmd tool or you can use PowerShell.

Steps to configure Network Card via PowerShell

  1. Import-Module NetTCPIP
  2. Import-Module NetAdapter
  3. New-NetIPAddress -InterfaceAlias “Cluster” -IPAddress 1.1.1.1 -PrefixLengh “24” -DefaultGateway 1.1.1.1
  4. Set-DNSClientServerAddress -InterfaceAlias “Cluster” -ServerAddresses “1.1.1.1”,”2.2.2.2″

Subscribe For Latest Updates

Sign up for best of digital marketing, livestream and technology opinions on what matters to you.

Invalid email address
We promise not to spam you. You can unsubscribe at any time.

1 thought on “Configure Network Cards for your Windows Server 2012 or Hyper-V 2012 server”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: