Switching Between the GUI and Server Core in Windows Server 2012.docx

download Switching Between the GUI and Server Core in Windows Server 2012.docx

of 8

Transcript of Switching Between the GUI and Server Core in Windows Server 2012.docx

Switching Between the GUI and Server Core in Windows Server 2012Windows Server Core was a terrific introduction when first introduced several years ago. Most organizations dont need a full-blown graphical interface for their servers and this was a great option. Of course, a major challenge is configuring server core. This has gotten easier over time, and with Windows Server 2012 we have a new option that makes this super easy: We can build and configure a server with a GUI and then take it away, turning the box into a Server Core installation.This is possible because the server GUI in Windows Server 2012 is now an optional feature which means it can be installed and removed as necessary.Switching from GUI Mode to Server Core ModeTo make the transition, open Server Manager and click on Manage Remove Roles and Features. This will launch the wizard, as seen below in Figure 1.

Select a server from the list. I only have one, as you can see in Figure 2.

The implication here is that if you are running Remote Server Administration Tools (RSAT) on Windows 8, you can remotely make this change.Clicking Next brings up a list of server roles. I dont want to change any roles, so Ill click next which brings us to figure 3.

Scroll down to User Interfaces and Infrastructure and expand as I have in Figure 4.

Ill uncheck Server Graphical Shell. Since there will be no GUI, there is no reason to keep the Graphical Management Tools and Infrastructure feature either. Note that when you uncheck this you may get a prompt about removing the PowerShell ISE. Thats fine to remove.You are finally presented with a summary, as seen below in Figure 5.

You can decide if you want to reboot when finished or manually handle it later. Click Remove to start the process as seen in Figure 6.

Note: If you are doing this on the server console I recommend closing all other windows and applications before starting this process. The process will require the server to be rebooted. But when the server reboots you will log on to a Server Core installation.GUI to Server Core: The PowerShell WayOf course, because this is Windows Server 2012, if you can manage it through the GUI you should be able to manage it from PowerShell. In this situation I can use Uninstall-WindowsFeature. Heres how I can do the same task but from my Windows 8 machine running RSAT.

PS C:\> Uninstall-WindowsFeature -name PowerShell-ISE,Server-Gui-Mgmt-Infra,Server-Gui-Shell -computer chi-dc03 -Restart

This will uninstall the same features and reboot when necessary. Want to know a bunch of Windows Server 2012 boxes back to Core? It couldnt be easier.Switching from Server Core to GUINaturally, this process can go the other way as well using either the GUI or PowerShell. If you want to use the GUI youll need another Windows Server 2012 running the Server Manager GUI or a Windows 8 client running RSAT.The procedure is essentially the same, except under Manage, select Add Roles and Features. Select Role-based or Feature-based installation.

As before, select the server and skip the roles. On the Features screen, scroll down and check the boxes for Graphical Management Tools and Server Graphical Shell. (At least, I dont see any reason not to have one without the other.) If you want the PowerShell ISE back, be sure to check that as well. Kick off the process, reboot, and youre back to a complete GUI.Server Core to GUI: The PowerShell WayThe PowerShell way is just as easy as before, except now we use Add-WindowsFeature:

PS C:\> Add-WindowsFeature -name PowerShell-ISE,Server-Gui-Mgmt-Infra,Server-Gui-Shell -computer chi-dc03 Restart

Note that if you want to do this at the server console, this is the only way you can restore the GUI.Switching between a full-blown GUI and server core is very easy in Windows Server 2012, and you can even apply the change to multiple machines. Using Server Manager is a pretty simple solution. Remember, you can do this from a Windows 8 box with RSAT. The PowerShell commands lend themselves nicely to workflows. Or, because the process requires a reboot, you might want to set your command up as a one-time scheduled task.GUI? Server core? Now you can have it all for the price of a reboot.How can I configure Server Core 2012?Server Core is the default installation option in Windows Server 2012, but many will choose the full GUI because its easier to configure and manage. In this article, Ill show you how to set basic configuration parameters in Server Core so that you can get it up and running quickly, and take advantage of the small footprint and reduced attack surface.Rename Server CoreOnce Server Core has installed, log on with the local administrator account and run the following command in the console: sconfig

The first task is to give the server a useful name. You can see in the figure above that a name has been automatically generated, but it doesnt have any meaning on my network or help me to identify the server. To change the servers name, do the following. Type 2 in the Server Configuration console window and press Enter. Now type a new name for the server and pressEnter again. Click OK in the dialog to restart the server.Network settings Assign the server a static IP address. Open the Server Configuration console again by typing sconfig. Choose Network Settings (8) and pressEnter.Youll see a list of network adapters and corresponding index numbers. Choose the network adapter that you want to configure by typing its index number and pressingEnter. Usually the index number is 12, but this can vary. Choose Set Network Adapter Address (1). To change from automatic DHCP configuration to a static IP address, choose (S)tatic and pressEnter. Now type the static IP address you want to assign to the adapter and pressEnter. Do the same for the network subnet mask and default gateway. Now choose the Set DNS Severs (2) option. In this example Im going to set the preferred DNS server to a domain controller, so that I can join Server Core to my domain, and the secondary DNS server will be left empty. Choose Return to the Main Menu (4).Join Server Core to a domainSconfig doesnt allow us to join Server Core to a domain. To do that, start PowerShell from the command line console: Type PowerShell and pressEnter. Now type Add-Computer DomainName ad.contoso.com, replacing ad.contoso.com with the Fully Qualified Domain Name (FQDN) of your domain. When prompted, type the username and password in the pop-up dialog of a user that has permission to add devices to your domain. Youll then be prompted in the PowerShell console to restart the server. Type shutdown /r and press Enter to restart the server.