Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ targetting Windows Server Core

We want to compile an existing C++ application (using Visual Studio 2019) so that it targets/runs on Windows Server Core. What is the correct way to tell the compiler that we are targeting Server Core ?

We found the pre-processor definition WINAPI_FAMILY=WINAPI_FAMILY_SERVER but my search results seem to indicate that it targets the more restrictive Windows Server Nano rather than Server Core.

like image 600
Anthony Avatar asked Dec 02 '25 00:12

Anthony


1 Answers

I couldn't find anything for building against it specifically but there is a good article breakdown about it: https://learn.microsoft.com/en-us/windows-server/administration/server-core/what-is-server-core

Additionally within it are two articles that should help you narrow things down to target it in addition to knowing what minimum windows version to support to help you pick the right SDKs. Look for things that I prefixed with ✓ ✓ ✓.

I know it's not the answer you wanted but it can help get you started by at least understanding what you can and cannot develop for.

I distilled from that this abridged list of out-of-the-box supported roles, role services, and features. Below it is link to both articles with their tables also quoted in case of link-death.

The OP also provided in a comment below this very helpful URL for the supported APIs and their respective DLLs leveraged to access them: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ee391646%28v%3dvs.85%29

Roles included in Server Core

Role => Name

File and Storage Services => FileAndStorage-Services

.

Role services included in Server Core

Role => Role service => Name

File and Storage Services => Storage Services => Storage-Services

.

Features included in Server Core

Feature => Name
.NET Framework 4.6 Features => NET-Framework-45-Features
.NET Framework 4.6 => NET-Framework-45-Core
WCF Services => NET-WCF-Services45
TCP Port Sharing => NET-WCF-TCP-PortSharing45
SMB 1.0/CIFS File Sharing Support => FS-SMB1
Windows Defender Features => Windows-Defender-Features
Windows Defender => Windows-Defender
Windows PowerShell => PowerShellRoot
Windows PowerShell 5.1 => PowerShell
WoW64 Support => WoW64-Support

These are the quoted parts of the articles that are included with Windows Server Core out-of-the-box/incuded by default. Following that are the quoted tables of info in case of link-death.

1. Features not in Windows Server - Server Core

Roles not in Server Core

Fax Server (Fax)
MultiPoint Services (MultiPointServerRole)
Network Policy and Access Services (NPAS)
Windows Deployment Services (WDS) (before Windows Server version 1803)

.

Role Services not in Server Core

Note that some Remote Desktop role services are included in Server Core (Connection Broker, Licensing, Virtualization Host), but others are NOT (Gateway, RD Session Host, Web Access).

Print and Document Services \ Distributed Scan Server (Print-Scan-Server)
Print and Document Services \ Internet Printing (Print-Internet)
Remote Desktop Services \ Remote Desktop Gateway (RDS-Gateway)
Remote Desktop Services \ Remote Desktop Session Host (RDS-RD-Server)
Remote Desktop Services \ Remote Desktop Web Access (RDS-Web-Access)
Role Service Web Server (IIS) \ Management Tools \ IIS Management Console (Web-Mgmt-Console)
Role Service Web Server (IIS) \ Management Tools \ IIS 6 Management Compatibility \ IIS 6 Management Console (Web-Lgcy-Mgmt-Console)
Windows Deployment Services \ Deployment Server (WDS-Deployment)
Windows Deployment Services \ Transport Server (WDS-Transport) (before Windows Server version 1803)

.

Features not in Server Core

Background Intelligent Transfer Service (BITS) \ IIS Server Extension (BITS-IIS-Ext)
BitLocker Network Unlock (BitLocker-NetworkUnlock)
Direct Play (Direct-Play)
Internet Printing Client (Internet-Print-Client)
LPR Port Monitor (LPR-Port-Monitor)
Message Queuing \ Message Queuing Services \ Multicasting Support (MSMQ-Multicasting)
RAS Connection Manager Administration Kit (CMAK)
Remote Assistance (Remote-Assistance)
Remote Server Administration Tools \ Feature Administration Tools \ SMTP Server Tools (RSAT-SMTP)
Remote Server Administration Tools \ Feature Administration Tools \ BitLocker Drive Encryption Administration Utilities \ BitLocker Drive Encryption Tools (RSAT-Feature-Tools-BitLocker-RemoteAdminTool)
Remote Server Administration Tools \ Feature Administration Tools \ BITS Server Extensions Tools (RSAT-Bits-Server)
Remote Server Administration Tools \ Feature Administration Tools \ Network Load Balancing Tools (RSAT-NLB)
Remote Server Administration Tools \ Feature Administration Tools \ SNMP Tools (RSAT-SNMP)
Remote Server Administration Tools \ Feature Administration Tools \ WINS Server Tools (RSAT-WINS)
Remote Server Administration Tools \ Role Administration Tools \ Hyper-V Management Tools \ Hyper-V GUI Management Tools (Hyper-V-Tools)
Remote Server Administration Tools \ Role Administration Tools \ Remote Desktop Services Tools \ Remote Desktop Gateway Tools (RSAT-RDS-Tools)
Remote Server Administration Tools \ Role Administration Tools \ Remote Desktop Services Tools \ Remote Desktop Gateway Tools (RSAT-RDS-Gateway)
Remote Server Administration Tools \ Role Administration Tools \ Remote Desktop Services Tools \ Remote Desktop Licensing Diagnoser Tools (RSAT-RDS-Licensing-Diagnosis-UI)
Remote Server Administration Tools \ Role Administration Tools \ Remote Desktop Services Tools \ Remote Desktop Licensing Tools (RDS-Licensing-UI)
Remote Server Administration Tools \ Role Administration Tools \ Windows Server Update Services Tools \ User Interface Management Console (UpdateServices-UI)
Remote Server Administration Tools \ Role Administration Tools \ Active Directory Certificate Services Tools (RSAT-ADCS)
Remote Server Administration Tools \ Role Administration Tools \ Active Directory Certificate Services Tools \ Certification Authority Management Tools (RSAT-ADCS-Mgmt)
Remote Server Administration Tools \ Role Administration Tools \ Active Directory Certificate Services Tools \ Online Responder Tools (RSAT-Online-Responder)
Remote Server Administration Tools \ Role Administration Tools \ Active Directory Rights Management Services Tools (RSAT-ADRMS)
Remote Server Administration Tools \ Role Administration Tools \ Fax Server Tools (RSAT-Fax)
Remote Server Administration Tools \ Role Administration Tools \ File Services Tools (RSAT-File-Services)
Remote Server Administration Tools \ Role Administration Tools \ File Services Tools \ DFS Management Tools (RSAT-DFS-Mgmt-Con)
Remote Server Administration Tools \ Role Administration Tools \ File Services Tools \ File Server Resource Manager Tools (RSAT-FSRM-Mgmt)
Remote Server Administration Tools \ Role Administration Tools \ File Services Tools \ Services for Network File System Management Tools (RSAT-NFS-Admin)
Remote Server Administration Tools \ Role Administration Tools \ Network Policy and Access Services Tools (RSAT-NPAS)
Remote Server Administration Tools \ Role Administration Tools \ Print and Document Services Tools (RSAT-Print-Services)
Remote Server Administration Tools \ Role Administration Tools \ Volume Activation Tools (RSAT-VA-Tools)
Remote Server Administration Tools \ Role Administration Tools \ Windows Deployment Services Tools (WDS-AdminPack)
Simple TCP/IP Services (Simple-TCPIP)
SMTP Server (SMTP-Server)
TFTP Client (TFTP-Client)
WebDAV Redirector (WebDAV-Redirector)
Windows Biometric Framework (Biometric-Framework)
Windows Defender Features \ GUI for Windows Defender (Windows-Defender-Gui)
Windows Identity Foundation 3.5 (Windows-Identity-Foundation)
Windows PowerShell \ Windows PowerShell ISE (PowerShell-ISE)
Windows Search Service (Search-Service)
Windows TIFF IFilter (Windows-TIFF-IFilter)
Wireless LAN Service (Wireless-Networking)
XPS Viewer (XPS-Viewer)

2. Features included in Windows Server - Server Core

Roles included in Server Core

The Server Core installation option includes the following server roles.

Role => Name => Installed by default?

Active Directory Certificate Services => AD-Certificate => N
Active Directory Domain Services => AD-Domain-Services => N
Active Directory Federation Services => ADFS-Federation => N
Active Directory Lightweight Directory Services => ADLDS => N
Active Directory Rights Management Services => ADRMS => N
Device Health Attestation => DeviceHealthAttestationService => N
DHCP Server => DHCP => N
DNS Server => DNS => N
✓ ✓ ✓ File and Storage Services => FileAndStorage-Services => Y
Host Guardian Service => HostGuardianServiceRole => N
Hyper-V => Hyper-V => N
Print and Document Services => Print-Services => N
Remote Access => RemoteAccess => N
Remote Desktop Services => Remote-Desktop-Services => N
Volume Activation Services => VolumeActivation => N

Web Server IIS => Web-Server => N

Windows Server Essentials Experience => ServerEssentialsRole => N
Windows Server Update Services => UpdateServices => N

.

Role services included in Server Core

The Server Core installation option includes the following role services.

Role => Role service => Name => Installed by default?

Active Directory Certificate Services => Certification Authority => ADCS-Cert-Authority => N

Certificate Enrollment Policy Web Service => ADCS-Enroll-Web-Pol => N
Certificate Enrollment Web Service => ADCS-Enroll-Web-Svc => N
Certification Authority Web Enrollment => ADCS-Web-Enrollment => N
Network Device Enrollment Service => ADCS-Device-Enrollment => N
Online Responder => ADCS-Online-Cert => N

Active Directory Rights Management => Active Directory Rights Management Server => ADRMS-Server => N

Identity Federation Support => ADRMS-Identity => N

File and Storage Services => File and iSCSI Services => File-Services => N

File Server => FS-FileServer => N
BranchCache for Network Files => FS-BranchCache => N
Data Deduplication => FS-Data-Deduplication => N
DFS Namespaces => FS-DFS-Namespace => N
DFS Replication => FS-DFS-Replication => N
File Server Resource Manager => FS-Resource-Manager => N
File Server VSS Agent Service => FS-VSS-Agent => N
iSCSI Target Server => iSCSITarget-Server => N
iSCSI Target Storage Provider (VDS and VSS hardware providers) => iSCSITarget-VSS-VDS => N
Server for NFS => FS-NFS-Service => N
Work Folders => FS-SyncShareService => N
✓ ✓ ✓ Storage Services => Storage-Services => Y

Print and Document Services => Print Server => Print-Server => N

LPD Service => Print-LPD-Service => N

Remote Access => DirectAccess and VPN (RAS) => DirectAccess-VPN => N

Routing => Routing => N
Web Application Proxy => Web-Application-Proxy => N

Remote Desktop Services => Remote Desktop Connection Broker => RDS-Connection-Broker => N

Remote Desktop Licensing => RDS-Licensing => N
Remote Desktop Virtualization Host => RDS-Virtualization => N
Web Server (IIS) => Web Server => Web-WebServer => N
Common HTTP Features => Web-Common-Http => N
Default Document => Web-Default-Doc => N
Directory Browsing => Web-Dir-Browsing => N
HTTP Errors => Web-Http-Errors => N
Static Content => Web-Static-Content => N
HTTP Redirection => Web-Http-Redirect => N
WebDAV Publishing => Web-DAV-Publishing => N
Health and Diagnostics => Web-Health => N
HTTP Logging => Web-Http-Logging => N
Custom Logging => Web-Custom-Logging => N
Logging Tools => Web-Log-Libraries => N
ODBC Logging => Web-ODBC-Logging => N
Request Monitor => Web-Request-Monitor => N
Tracing => Web-Http-Tracing => N
Performance => Web-Performance => N
Static Content Compression => Web-Stat-Compression => N
Dynamic Content Compression => Web-Dyn-Compression => N
Security => Web-Security => N
Request Filtering => Web-Filtering => N
Basic Authentication => Web-Basic-Auth => N
Centralized SSL Certificate Support => Web-CertProvider => N
Client Certificate Mapping Authentication => Web-Client-Auth => N
Digest Authentication => Web-Digest-Auth => N
IIS Client Certificate Mapping Authentication => Web-Cert-Auth => N
IP and Domain Restrictions => Web-IP-Security => N
URL Authorization => Web-Url-Auth => N
Windows Authentication => Web-Windows-Auth => N
Application Development => Web-App-Dev => N
.NET Extensibility 3.5 => Web-Net-Ext => N
.NET Extensibility 4.6 => Web-Net-Ext45 => N
Application Initialization => Web-AppInit => N
ASP => Web-ASP => N
ASP.NET 3.5 => Web-Asp-Net => N
ASP.NET 4.6 => Web-Asp-Net45 => N
CGI => Web-CGI => N
ISAPI Extensions => Web-ISAPI-Ext => N
ISAPI Filters => Web-ISAPI-Filter => N
Server Side Includes => Web-Includes => N
WebSocket Protocol => Web-WebSockets => N
FTP Server => Web-Ftp-Server => N
FTP Service => Web-Ftp-Service => N
FTP Extensibility => Web-Ftp-Ext => N
Management Tools => Web-Mgmt-Tools => N
IIS 6 Management Compatibility => Web-Mgmt-Compat => N
IIS 6 Metabase Compatibility => Web-Metabase => N
IIS 6 Scripting Tools => Web-Lgcy-Scripting => N
IIS 6 WMI Compatibility => Web-WMI => N
IIS Management Scripts and Tools => Web-Scripting-Tools => N
Management Service => Web-Mgmt-Service => N

Windows Server Update Services => WID Connectivity => UpdateServices-WidDB => N

WSUS Services => UpdateServices-Services => N
SQL Server Connectivity => UpdateServices-DB => N

.

Features included in Server Core

The Server Core installation option includes the following features.

Feature => Name => Installed by default?
.NET Framework 3.5 Features => NET-Framework-Features => N
.NET Framework 3.5 (includes .NET 2.0 and 3.0) => NET-Framework-Core => (removed)
HTTP Activation => NET-HTTP-Activation => N
Non-HTTP Activation => NET-Non-HTTP-Activ => N
✓ ✓ ✓ .NET Framework 4.6 Features => NET-Framework-45-Features => Y
✓ ✓ ✓ .NET Framework 4.6 => NET-Framework-45-Core => Y
ASP.NET 4.6 => NET-Framework-45-ASPNET => N
✓ ✓ ✓ WCF Services => NET-WCF-Services45 => Y
HTTP Activation => NET-WCF-HTTP-Activation45 => N
Message Queuing (MSMQ) Activation => NET-WCF-MSMQ-Activation45 => N
Named Pipe Activation => NET-WCF-Pipe-Activation45 => N
TCP Activation => NET-WCF-TCP-Activation45 => N
✓ ✓ ✓ TCP Port Sharing => NET-WCF-TCP-PortSharing45 => Y
Background Intelligent Transfer Service (BITS) => BITS => N
Compact Server => BITS-Compact-Server => N
BitLocker Drive Encryption => BitLocker => N
BranchCache => BranchCache => N
Client for NFS => NFS-Client => N
Containers => Containers => N
Data Center Bridging => Data-Center-Bridging => N
Enhanced Storage => EnhancedStorage => N
Failover Clustering => Failover-Clustering => N
Group Policy Management => GPMC => N
I/O Quality of Service => DiskIo-QoS => N
IIS Hostable Web Core => Web-WHC => N
IP Address Management (IPAM) Server => IPAM => N
iSNS Server service => ISNS => N
Management OData IIS Extension => ManagementOdata => N
Media Foundation => Server-Media-Foundation => N
Message Queuing => MSMQ => N
Message Queuing Services => MSMQ-Services => N
Message Queuing Server => MSMQ-Server => N
Directory Service Integration => MSMQ-Directory => N
HTTP Support => MSMQ-HTTP-Support => N
Message Queuing Triggers => MSMQ-Triggers => N
Routing Service => MSMQ-Routing => N
Message Queuing DCOM Proxy => MSMQ-DCOM => N
Multipath I/O => Multipath-IO => N
MultiPoint Connector => MultiPoint-Connector => N
MultiPoint Connector Services => MultiPoint-Connector-Services => N
MultiPoint Manager and MultiPoint Dashboard => MultiPoint-Tools => N
Network Load Balancing => NLB => N
Peer Name Resolution Protocol => PNRP => N
Quality Windows Audio Video Experience => qWave => N
Remote Differential Compression => RDC => N
Remote Server Administration Tools => RSAT => N
Feature Administration Tools => RSAT-Feature-Tools => N
BitLocker Drive Encryption Administration Utilities => RSAT-Feature-Tools-BitLocker => N
DataCenterBridging LLDP Tools => RSAT-DataCenterBridging-LLDP-Tools => N
Failover Clustering Tools => RSAT-Clustering => N
Failover Cluster Module for Windows PowerShell => RSAT-Clustering-PowerShell => N
Failover Cluster Automation Server => RSAT-Clustering-AutomationServer => N
Failover Cluster Command Interface => RSAT-Clustering-CmdInterface => N
IP Address Management (IPAM) Client => IPAM-Client-Feature => N
Shielded VM Tools => RSAT-Shielded-VM-Tools => N
Storage Replica Module for Windows PowerShell => RSAT-Storage-Replica => N
Role Administration Tools => RSAT-Role-Tools => N
AD DS and AD LDS Tools => RSAT-AD-Tools => N
Active Directory module for Windows PowerShell => RSAT-AD-PowerShell => N
AD DS Tools => RSAT-ADDS => N
Active Directory Administrative Center => RSAT-AD-AdminCenter => N
AD DS Snap-Ins and Command-Line Tools => RSAT-ADDS-Tools => N
AD LDS Snap-Ins and Command-Line Tools => RSAT-ADLDS => N
Hyper-V Management Tools => RSAT-Hyper-V-Tools => N
Hyper-V Module for Windows PowerShell => Hyper-V-PowerShell => N
Windows Server Update Services Tools => UpdateServices-RSAT => N
API and PowerShell cmdlets => UpdateServices-API => N
DHCP Server Tools => RSAT-DHCP => N
DNS Server Tools => RSAT-DNS-Server => N
Remote Access Management Tools => RSAT-RemoteAccess => N
Remote Access module for Windows PowerShell => RSAT-RemoteAccess-PowerShell => N
RPC over HTTP Proxy => RPC-over-HTTP-Proxy => N
Setup and Boot Event Collection => Setup-and-Boot-Event-Collection => N
Simple TCP/IP Services => Simple-TCPIP => N
✓ ✓ ✓ SMB 1.0/CIFS File Sharing Support => FS-SMB1 => Y
SMB Bandwidth Limit => FS-SMBBW => N
SNMP Service => SNMP-Service => N
SNMP WMI Provider => SNMP-WMI-Provider => N
Telnet Client => Telnet-Client => N
VM Shielding Tools for Fabric Management => FabricShieldedTools => N
✓ ✓ ✓ Windows Defender Features => Windows-Defender-Features => Y
✓ ✓ ✓ Windows Defender => Windows-Defender => Y
Windows Internal Database => Windows-Internal-Database => N
✓ ✓ ✓ Windows PowerShell => PowerShellRoot => Y
✓ ✓ ✓ Windows PowerShell 5.1 => PowerShell => Y
Windows PowerShell 2.0 Engine => PowerShell-V2 => (removed)
Windows PowerShell Desired State Configuration Service => DSC-Service => N
Windows PowerShell Web Access => WindowsPowerShellWebAccess => N
Windows Process Activation Service => WAS => N
Process Model => WAS-Process-Model => N
.NET Environment 3.5 => WAS-NET-Environment => N
Configuration APIs => WAS-Config-APIs => N
Windows Server Backup => Windows-Server-Backup => N
Windows Server Migration Tools => Migration => N
Windows Standards-Based Storage Management => WindowsStorageManagementService => N
WinRM IIS Extension => WinRM-IIS-Ext => N
WINS Server => WINS => N
✓ ✓ ✓ WoW64 Support => WoW64-Support => Y

From this entire list there's only 12 things supported out-of-the-box so that really limits you. They are respectively marked with ✓ ✓ ✓

like image 192
kayleeFrye_onDeck Avatar answered Dec 04 '25 16:12

kayleeFrye_onDeck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!