Configuring Server Core 2012r2 with Sconfig
is extremely limited. Especially when you need to configure advanced network settings. SConfig only allows configuring one ip address and two dns server addresses, while not even allowing you to set ipv6 addresses or ipv6 DNS Server addresses, which are extremely important in today’s enterprise networks, especially when running Exchange. Thank God for PowerShell! I will now begin documenting how to configure ServerCore 2012R2 Advanced Network Settings with Powershell. In my opinion, this is the only way it should be done.
When ServerCore first opens you only have a command prompt and the server may even skip straight to the special SConfig command prompt with simple numbered options (1-15). You can go ahead and select option 2 to name the server. Restart the server and make sure that your date and time are correct. Once you set all the simple options, type “15” to exit to a command prompt and then type powershell_ise and press enter. This will open the almighty Powershell Integrated Scripting Environment, where you can set the Real Network Settings for the server.
The first cmdlet to run is Get-NetAdapter. This is used to get the interface index (ifIndex) of the server’s network adapter. I also usually suggest that you format the output of your commands with Out-GridView for a much easier way to read the output. In this case, you really don’t need to, however let’s get used to piping the output since it helps to get used to adding formatting options to the end of your cmdlets. So, in order to get just need to type:
Get-NetAdapter | Out-GridView. You can easy use the alias “ogv” instead of typing Out-GridView so that would look like this:
Get-NetAdapter | ogv
The output of this command will give you a pop-out box with your network adapters listed by Name, Interface Description, ifIndex, Status, MacAddress, and linkspeed. Make sure you remember the ifIndex (Interface Index) of your active network adapter, because you will need this to set the DNS Client Server Addresses in the next step.
Okay now starts the good stuff, we are going to set both the ipv4 and the ipv6 DNS Client Server Addresses with the following command:
Set-DNSClientServerAddress -ifIndex(#fromAboveCommand) -ServerAddress (comma separated list of ipv4 DNS Server addresses and then ipv6 DNS Server addresses)
EXAMPLE: Set-DNSClientServerAddress -ifIndex 17 -ServerAddress 192.168.1.5,192.168.1.6,192.168.1.7,fddd:f5d3:3d77:fde2::1,fddd:f5d3:3d77:fde2::2,fddd:f5d3:3d77:fde2::3
Next we can look at all the Network Adapter Advanced Properties with
Get-NetAdapterAdvancedProperty -AllProperties | Out-GridView
This will pop out a box with all the Network Adapter Advanced Properties currently set on all installed Interfaces. To configure or change any of these settings we will use
Let’s add an example which will configure the Jumbo Frame/Jumbo Packet Advanced Property on a Hyper-V wired ethernet adapter.
Set-NetAdapterAdvancedProperty -Name "Ethernet" -DisplayName "Jumbo Frame" -RegistryKeyword "*JumboPacket" -RegistryValue "4096"
Now you can use this command while changing the DisplayName, DisplayValue, RegistryKeyword, or RegistryValue to any setting that you wish to change on your ServerCore 2012R2 box.