1.Instal windows core
Windows Server Core 2012R2
After installation from your media Iso file you can set the default settings like:
Computername, Join Domain, Set remote desktop, Enable Remote managment, set ipadresses, set date and time and activate your copy off windows server.
C:\Sconfig
If you have Windows server 2012 Core or Hyper-V 2012 server you can face problems where you want to open admin shares on server. If you type \\servername\c$ you will receive error message that you can’t reach this share.
This is because File and Printer sharing is disabled by default in Windows Server 2012 and in Hyper-V 2012. To enable File and Printer Sharing in command prompt you must type:
netsh advfirewall firewall set rule group=”File and Printer Sharing” new enable=Yes
For 2008 Servers :
Configuring networking
Every installation of Windows Server 2008 automatically defaults to contacting a DHCP server to obtain an IP address. If your network doesn’t contain a DHCP server your Windows Server 2008 installation will use Automatic Private IP Addressing (APIPA), as described in RFC 3927 and Microsoft KnowledgeBase article 220874.
Since services define a server (else you’d better call it a workstation) and services need to be found it’s a best practice to provide your server with an appropriate name and a fixed IP address.
Changing the name of your Server Core box is easy when you use the netdom command. Assuming your fresh Server Core installation isn’t part of an Active Directory I suggest you use the following command:
netdom renamecomputer localhost /NewName:NewNameForYourServer
After renaming the box you can change its IP configuration. In my opinion using the netsh command resembles using the windows to configure these settings. (There are other methods to change the IP address though)
To change the IP v4 address for your Local Area Connection, type:
netsh interface ip set address “Local Area Connection” static IPAddress SubNetMask IPAddressOfDefaultGateway 1
netsh interface ip set dns “Local Area Connection” static IPAddressOfDNSServer
You can check the configuration with the ipconfig /all command.
Configuring the firewall
I already explained Server Core acts as a file server without installing anything. All you need to do is permit file services through the firewall. In the standard firewall configuration there’s already a pre-built exception you can enable by typing the following command:
netsh firewall set service fileandprint
2.Change core to gui or gui to core
Server Core 2012R2 to Gui or from Gui To Core from internet source.
Below the DVD Source how to.
Create PS1.
or download from : https://gallery.technet.microsoft.com/scriptcenter/Switch-between-Windows-9680265d
Import-Module Servermanager
Set-ExecutionPolicy Unrestricted
switch ($id) { "1" {Uninstall-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell} "2" {Install-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell} "3" { Import-Module Dism Enable-WindowsOptionalFeature -online -Featurename ServerCore-FullServer,Server-Gui-Shell,Server-Gui-Mgmt } }
Note: If Server 2012 with the Server Core option has never converted to Server GUI mode, this server will not contain the necessary source file to switch to GUI mode (option 2). Please keep the server online (connected to the Internet) and select option 3.
Uninstall the Gui to make Windows
Be sure to set the correct ip adress settings with Sconfig.
To test connectivity with PowerShell.R2 a Core Server:
Uninstall-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra
C:\>POWERSHELL
PS C:\>[System.Reflection.Assembly]::LoadWithPartialName(“System.web”)
PS C:\>$WebClient=new-object Net.WebClient
PS C:\>$WebClient.DownloadString(http://www.nu.nl/)
Or Simple Ping a website that you know it will respond to ping.
C:\ping www.nu.nl
Server Core 2012R2 to Gui or from Gui To Core from DVD WIM source.
Windows Hyper V console or VMware console.
Mount the Virtual Dvd Drive.
Insert the DVD 2012r2 ISO source.
Open windows powershell from remote desktop/HyperV console or from server manager.
1. Import-Module Servermanager
2. Install-WindowsFeature Server-Gui-Mgmt-Infra,Server-Gui-Shell –Source wim:d:\sources\install.wim:4
(you can only install from the WiM file that holds the GUI files, Core therefore has no Gui Files in the installation WIM file)
3. Restart the Server.
For installing the Gui and make Windows server 2012R2 a Core server:
Uninstall-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra -Restart
For uninstalling only the internet Explorer and file explorer:
Get-WindowsFeature Server-Gui-Shell | Uninstall-WindowsFeature –Restart
To be sure your wim number is the correct index number, type and replace d where it is the letter of your DVD ISO drive.
dism /Get-WimInfo /WimFile:d:\sources\install.wim
output is :
Details for image : d:\sources\install.wim
Index : 1
Name : Windows Server 2012 R2 SERVERSTANDARDCORE
Description : Windows Server 2012 R2 SERVERSTANDARDCORE
Size : 6,898,373,863 bytes
Index : 2
Name : Windows Server 2012 R2 SERVERSTANDARD
Description : Windows Server 2012 R2 SERVERSTANDARD
Size : 12,051,460,352 bytes
Index : 3
Name : Windows Server 2012 R2 SERVERDATACENTERCORE
Description : Windows Server 2012 R2 SERVERDATACENTERCORE
Size : 6,871,511,192 bytes
Index : 4
Name : Windows Server 2012 R2 SERVERDATACENTER
Description : Windows Server 2012 R2 SERVERDATACENTER
Size : 12,065,366,117 bytes
To get more information on the index version :
dism /Get-WimInfo /WimFile:d:\sources\install.wim /index:1
output is like :
Index : 1
Name : Windows Server 2012 R2 SERVERSTANDARDCORE
Description : Windows Server 2012 R2 SERVERSTANDARDCORE
Size : 6,898,373,863 bytes
WIM Bootable : No
Architecture : x64
Hal : acpiapic
Version : 6.3.9600
ServicePack Build : 17031
ServicePack Level : 0
Edition : ServerStandardEval
Installation : Server Core
ProductType : ServerNT
ProductSuite : Terminal Server
System Root : WINDOWS
Directories : 13547
Files : 70219
Created : 3/21/2014 – 12:31:02 PM
Modified : 3/21/2014 – 12:31:24 PM
Languages :
en-US (Default)
Other options then Full Core or Full GUI with Infra:
Server Core Option
If the server has a full installation of Windows Server, the following command removes the two features: Server Graphical Shell and Graphical Management Tools and Infrastructure, and the resulting installation is Server Core.
Get-WindowsFeature *gui* | Uninstall-WindowsFeature –Restart
Minimal Server Interface
If the server has a full installation of Windows Server, and I need to bring the server down to minimal server interface, I only need to remove the Server-GUI-Shell. The command is shown here.
Get-WindowsFeature Server-Gui-Shell | Uninstall-WindowsFeature –Restart
Server with a GUI
If the Windows Server is installed with “Server with a GUI,” the following two features are installed.
Get-WindowsFeature Server-Gui-Mgmt-Infra, Server-Gui-Shell
If the server is in Server Core mode, this command adds the two features and brings the server up to the Server with a GUI level.
Get-WindowsFeature Server-Gui-Mgmt-Infra, Server-Gui-Shell | Install-WindowsFeature –restart
Server with Desktop Experience Added (Windows 8 desktop mode)
If the server is at “Server with a GUI” mode, then the Desktop-Experience feature is not installed. This command verifies that fact.
Get-WindowsFeature Desktop-Experience
Install or uninstall with Server Manager from another server.
Open Server manager and select the server that you want to manage for the installation:” installing or uninstalling the Gui.”
Turning the GUI Off
In Windows Server 8 the GUI has kept with the modular nature of recent Windows Server Operating Systems and in turn has become a “Feature”. This makes removing the GUI very easy. To get started launch Server Manager.
Click on Manage, and then select Remove Roles or Features from the menu.
Click next to skip past the before you begin page, then select your server from the server pool and click next.
Since the GUI is not a Role, we can just click next again to skip past the Roles section.
When you reach the Features page, you need to uncheck the box next to the “User Interfaces and Infrastructure” option, and then click next.
Now tick the “Restart Destination Server” box, then click remove.
The GUI will now be removed.
After the binaries are removed your server will automatically reboot.
Once it comes back up, and you log in, you will only be able to use the command line.
Turning the GUI On
Once the GUI has been turned off, you will want to know how to get it back. To do this we use SConfig, so go ahead and type SConfig into the command line and hit enter.
You can see near the bottom of the screen that we can use “12” to Restore the GUI, so type 12 and hit enter.
You will be warned that enabling the GUI requires a reboot, click the yes button.
That will kick off DISM which will start to add the binaries for the GUI Shell.
When its finished you will be asked if you would like to restart the computer now, type “y” and hit enter to reboot.
GUI Off with PowerShell
You can do the same thing as we did in the GUI much quicker with a PowerShell cmdlet. To do so, open Server Manager, click on Tools and launch PowerShell.
We can use the Remove-WindowsFeature cmdlet to remove the feature:
Remove-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra
Since Remove-WindowsFeature is just an alias, you could also use:
Uninstall-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra
Not long after you have hit the enter key, the removal will begin.
When it’s done, you will be notified that you need to restart your server to complete the process, which can be easily done from the current PowerShell window by running:
Shutdown –r -t 0
When your machine restarts you will only have the command line to work with .
GUI On with PowerShell
The first thing we need to do is get into PowerShell, so type PowerShell and hit enter.
Now we need to use the Add-WindowsFeature to add the components back:
Add-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra
Again this is just an alias for:
Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra
When its done, we will need to restart our server by using the Shutdown command:
Shutdown –r -t 0
When your server reboots you will have the GUI back.