Articles

Showing posts with label Windows Server Core. Show all posts
Showing posts with label Windows Server Core. Show all posts

Saturday, December 1, 2012

Joining Windows Server 2012 Core to a domain

You can use the netdom utility to join a Windows Server 2012 Core of Full server to a domain.

>netdom join %computername% /domain:yourdomain.local /userd:<DomainAdmin> /passwordd: /reboot:0

If you're using the PowerShell console substitute %computername% with $env:computername.

Changing the hostname on Windows Server 2012

Use the following commands to change the hostname on a Windows Server 2012 Core or Full server from the command line. This can be done with either the Command Prompt or PowerShell console:

Change the hostname from the Command Prompt

> netdom renamecomputer %computername% /newname:<NewName> /reboot:0

Change the hostname from the PowerShell console

> netdom renamecomputer $env:computername /newname:<NewName> /reboot:0


You will be warned that certain services such as Active Directory Certificate Services may not function correctly after changing the hostname. If you do not want to reboot the system immediately omit the /reboot switch. To reboot the server a later time use shutdown -r -t 0.

Adding and removing the GUI from Windows Server 2012

Microsoft introduced the ability to add and remove the GUI from Windows Server 2012 in case you find yourself lost with only a Command Prompt for administration and configuration of your servers. If you do a Core installation of Windows Server 2012 and want to add the full GUI back to your server you can use the Install-WindowsFeature cmdlet to install it.

To install the full GUI

> Install-WindowsFeature Server-Gui-Mgmt-Infra, Server-Gui-Shell -Restart

To uninstall the GUI from a full installation of Windows Server 2012

> Uninstall-WindowsFeature Server-Gui-Mgmt-Infra, Server-Gui-Shell -Restart

You may be wondering why you would ever want to uninstall the GUI? A good scenario is that you want to configure your server initially using the graphical tools, and after it's full configured, you want to reduce the footprint and attack surface of your server.


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