Windows Server Core – Basics
Introduction
Section titled “Introduction”On this page the brief background and basics of Windows Server Core will be explained. There will also be some command’s listed below that are often used on Windows Server Core.
Background on Windows Server Core and Nano
Section titled “Background on Windows Server Core and Nano”Windows Server 2016 and later editions can be installed in different modes, mainly Desktop Experience (GUI), Server Core, and Nano Server.
- Desktop Experience is the full GUI installation, easier for beginners but heavier in resource use and attack surface.
- Server Core is the recommended edition for production: it removes the GUI, uses fewer resources, and reduces the attack surface. Administration happens via PowerShell, command line, sconfig.cmd, or remotely with RSAT/Server Manager. Almost all roles can be installed, including ADDS, RODC, DNS, DHCP, etc.
- Nano Server (deprecated in later versions) was even smaller, designed for containers and cloud scenarios, managed only remotely. Now only available as a Docker image for applications like web servers.
Key configuration tasks on Server Core include:
- Network setup with
netshor PowerShell. - Activation with
slmgr.vbs. - Domain join with
netdomor PowerShell. - Sysprep for SID regeneration, located at
C:\Windows\System32\Sysprep. - mountvol for working with volume mount points.
Windows Server Core Summary
Section titled “Windows Server Core Summary”Pros of Core – Less resources, smaller attack surface and less reboots needed.
Cons Core – Geen GUI maakt het moeilijker.
Server Roles on Core – Nearly all roles are available, with the exception of:
- Remote Desktop Session Host (RDSH) in some versions.
- GUI-dependant roles
RODC role on Core – It’s a best practice to run a Read Only Domain Controller on a Windows Server Core version.
Windows Server Core commando’s
Section titled “Windows Server Core commando’s”Basics
Section titled “Basics”Reboot a Core Server
shutdown /r /t 0
Syntax domain join – Command for a core server to join a doamin.
netdom join %computername% /domain:contoso.com /userd:Admin /passwordd:*
Remote Powershell management – Command to start a Powershell-session from a different device in the domain.
Invoke-PSSession -ComputerName <hostname>
slmgr.vbs (Licentiebeheer)
Section titled “slmgr.vbs (Licentiebeheer)”slmgr.vbs = Windows Script Host-tool voor licentiebeheer.
| Commando | Betekenis | Functie |
|---|---|---|
slmgr /ipk <key> | Install Product Key | Installs or replaces product keys in Windows. |
slmgr /ato | Activate Online | Activates Windows or Office with the initialized product key over the internet or KMS. |
slmgr /dlv | Display License Information Verbose | Shows detailed license-information (status, type, KMS-data, activation-ID’s). |
Control commando’s (Date, Time, Region)
Section titled “Control commando’s (Date, Time, Region)”Controll command’s open components of the classic Controll Panel.
| Commando | Onderdeel | Doel |
|---|---|---|
control timedate.cpl | Date and time | Opens the window fior timezone, time and internet-timesettings. |
control intl.cpl | Country or Region | Opens languange-, notation- and regional settings (like: currency and date-format) |
Configures the networkstack (IP, DNS, firewall, etc.). Not only the interfaces, but broader. Show IP interfaces – Command to show interfaces and their settings.
netsh interface ipv4 show interfaces/config <id>Configure IP-address – Commandto configure IP settings.
netsh interface ipv4 set address name=<id> source=static/dhcp address=<staticip> mask=<sub.mask> gateway=<ip>Configure DNS – Commands to configure DNS servers for the different interfaces. Index = the order (primary (1), secundary (2), etc.).
netsh interface ipv4 add dnsserver name=<id> address=<IPDNS> index=<nr>Open firewall port – Command to open up a firewall port for a (known) service (that knows ports).
netsh advfirewall firewall set rule group="windows remote management" new enable=yesEnable firewall service – Command to enable the service (remotemanagement in this case) and listen where the port is now open.
netsh advfirewall set currentprofile settings remotemanagementnetsh advfirewall set allprofiles state on/offFeatures: ADDS
Section titled “Features: ADDS”Install features – Command to install the ADDS features with a PowerShell command.
Install-WindowsFeature AD-Domain-Services -IncludeManagementToolsCreate a new domain – Command to create a new domain.
Install-ADDSForest -DomainName domainnamePromote a domain controller – Command to award a domain controller to a domain and with that promote it to a domain controller.
Install-ADDSDomainController -DomainName "domainname" -credential $(get-credential)Features: DHCP
Section titled “Features: DHCP”Install features – Command to install the DHCP feature with a PowerShell command.
Install-WindowsFeature -Name 'DHCP' -IncludeManagementToolsCreate a new scope – Command to create a new DHCP scope.
Add-DhcpServerV4Scope -Name "DHCP Scope" -StartRange 192.168.1.150 -EndRange 192.168.1.200 -SubnetMask 255.255.255.0Setup DHCP default settings – Commando to setup de default settings for the DHCP server.
Set-DhcpServerV4OptionValue -DnsServer 192.168.1.10 -Router 192.168.1.1Setup DHCP lease duration – Command to setup the lease duration for a DHCP scope.
Set-DhcpServerv4Scope -ScopeId 192.168.1.10 -LeaseDuration 1.00:00:00Mountvol
Section titled “Mountvol”Mountvol is used to mount and unmount of volumes with GUID.
Mountvol number – This is not a number, but a Volume GUID (Globally Unique IDentifier). It is used to mount volumes to a path.
Mountvol /d – This removes the link between a volume and a mount point.
📌 Key Commands
Section titled “📌 Key Commands”- Show network config:
netsh interface ip show config - Setup TCP/IP:
netsh interface ip set address name="Ethernet0" static <IP> <MASK> <GW> - Setup DNS:
netsh interface ip add dns name="Ethernet0" address=<DNS> index=1 - Restart server:
shutdown /r /t 0 - Domain join:
netdom join %computername% /domain:<domain> /userd:<user> /passwordd:* - Install ADDS:
Install-WindowsFeature AD-Domain-Services - Activation:
slmgr.vbs /ipk <key>andslmgr.vbs /ato - Sysprep:
C:\Windows\System32\Sysprep\sysprep.exe - Mountvol:
mountvol [Drive:]Path VolumeNamedevcon rescandiskpart > rescan > exit