Articles

Friday, November 30, 2012

Windows Server 2012 - Renaming Network Interfaces from the Command Line

Every since I started using Linux as my primary desktop OS I've gotten used to configuring network settings from the command line. Linux names network interfaces according to what type of interface they are, ethernet, wireless, tunnel, etc, using the naming convention ethX, wlanX, tunX, where X is an incremental integer.

By default in Windows Server 2012 ethernet adapters have the name Ethernet, which to me is too much to type when configuring network settings on a Windows server from the command line with netsh. You can rename your interfaces using the following commands in Windows:

Get a list of current interfaces on the system:

>netsh int show interface

Admin State    State          Type             Interface Name
-------------------------------------------------------------------------
Enabled        Connected      Dedicated        Ethernet


Rename the interface using the Linux naming convention:

>netsh int set interface name="Ethernet" newname=eth0

Enabling RDP on Windows Server 2012 Core


Because the Core editions of Windows Server have no GUI we can't use the Server Manager (at least locally) to enable connections over RDP to the Windows Core host. To get around that Microsoft includes a WSH script with the Core editions that can run from the Command Prompt. Use the following command to enable RDP on your Core servers.

cd \windows\system32
cscript scregedit.wsf /AR 0

You can use the /v switch to check the state of the RDP setting. If it shows 1, RDP connections are not enabled, if it's 0 they are.

Below is a list of all the options for the scregedit.wsf script:

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Automatic Updates - Manage Automatic Windows Updates
These settings can be used to configure how Automatic Updates are applied to
the Windows system. It includes the ability to disable automatic updates and
to set the installation schedule.

/AU [/v][value]

/v View the current Automatic Update settings
value value you want to set to.

Options:
4 - Enable Automatic Updates
1 - Disable Automatic Updates


Terminal Service - Allow Remote Administration Connections
This allows administrators to connect remotely for administration purposes.

/AR [/v][value]

/v View the Remote Terminal Service Connection setting
value (0 = enabled, 1 = disabled)


Terminal Service - Allow connections from previous versions of Windows
This setting configures CredSSP based user authentication for
Terminal Service connections

/CS  [/v][value]

/v View the Terminal Service CredSSP setting
value (0 = allow previous versions, 1 = require CredSSP)


IP Security (IPSEC) Monitor - allow remote management
This setting configures the server to allow the IP Security (IPSEC) Monitor to
be able to remotely manage IPSEC.

/IM [/v][value]

   /v View the IPSEC Monitor setting
value (0 = do not allow, 1 = allow remote management)


DNS SRV priority - changes the priority for DNS SRV records
This setting configures the priority for DNS SRV records and is only useful
on Domain Controllers.
For more information on this setting, search TechNet for LdapSrvPriority

/DP [/v][value]

   /v View the DNS SRV priority setting
value (value from 0 through 65535. The recommended value is 200.)


DNS SRV weight - changes the weight for DNS SRV records
This setting configures the weight for DNS SRV records and is only useful
on Domain Controllers.
For more information on this setting, search TechNet for LdapSrvWeight

/DW [/v][value]

   /v View the DNS SRV weight setting
value (value from 0 through 65535. The recommended value is 50.)


Command Line Reference
This setting displays a list of common tasks and how to perform them from
the command line.

/CLI