niedziela, 22 czerwca 2014

How to switch to Server Core mode

After you setup Windows Server 2012, IT administrators may have to convert Server 2012 to Server Core mode for some security reasons.  Also, it is more convenient for administrators to change some configurations when using GUI mode.  To perform this action, use the following script sample.

Script

How to run the script:
  1. Open PowerShell in “Run as Administrator” mode.
  2. Switch to the path where you downloaded the script.
  3. Run the script directly.
Here are some code snippets for your references.
PowerShell
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 
                } 
        }

Examples

Example 1: How to switch to Server Core mode.
To switch to Server Core mode, run this script directly, and then select number “1”:
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.

Brak komentarzy:

Prześlij komentarz