Skip to content

Instantly share code, notes, and snippets.

@larsks
Created November 2, 2012 02:13
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save larsks/3998260 to your computer and use it in GitHub Desktop.
Save larsks/3998260 to your computer and use it in GitHub Desktop.
Setting up Windows Server Core

Initial configuration

  • Set the timezone

      tzutil /s "Eastern Standard Time"
    
  • Enable automatic updates:

      cscript \windows\system32\scregedit.wsf /AU 4
    
  • Enable Remote Desktop:

      cscript \windows\system32\scregedit.wsf /AR 1
    
  • Install PowerShell:

      dism /online /enable-feature /featurename:NetFx2-ServerCore
      dism /online /enable-feature /featurename:MicrosoftWindowsPowerShell
      dism /online /enable-feature /featurename:ServerManager-PSH-Cmdlets
    
  • Set PowerShell execution policy

      C:\>powershell
      PS C:\> Set-ExecutionPolicy RemoteSigned
    
  • Install updates:

      cscript \windows\system32\en-us\wuasearchdownloadinstall.vbs
    
  • Install and activate license key:

      slmgr /ipk <license key>
      slmgr /ato
    

Downloading from URLs with PowerShell

PS>$wc=new-object system.net.webclient
PS>$wc.downloadfile("your_url","your_file")

See the system.net.webclient documentation for more information.

Install Cygwin packages from command line

Use the -q flag to run Cygwin's setup.exe in batch mode.

setup.exe -q -n -P openssh git curl vim

Run ssh-host-config -y for initial sshd configuration.

Configuring the firewall

Opening up a port for ssh:

netsh advfirewall firewall add rule name=SSH protocol=TCP dir=in localport=22 action=allow

Show all firewall rules:

netsh advfirewall firewall  show rule name=all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment