Welcome to Dirteam.com/ActiveDir.org Blogs Sign in | Join | Help

The things that are better left unspoken

a blog by Sander Berkouwer
How to tell whether it's a Server Core box

It's easy to tell whether Windows Server 2008 is installed as Server Core. I know what you're thinking: "Duh! it only shows a command prompt window after you log on", but that's not what I wanted to show you today. What if you wanted to find out programmatically? What if you're WinRS'ing into a Windows Server 2008 box?

Not the way to do this

I fiddled a bit to retrieve this information from my systems but couldn't find a difference between full installations and server core installations when I used the following commands:

wmic OS get Caption

wmic OS get Name

systeminfo

Sure, I gathered a lot of information on the box and the Operating System I have installed, but couldn't find a shred of information on how the Operating System was installed in terms of a Server Core installation or a Full Installation.

The way to do this

The solution to determine whether you're dealing with a Server Core box, is to type the following command:

wmic OS get OperatingSystemSKU

When it returns any of the following values it's a Server Core box:

OperatingSystemSKU
(output on console)
OperatingSystemSKU
(hexidecimal value)
Server Core Edition
12 0x0000000C Windows Server 2008 Datacenter Edition, Server Core
39 0x00000027 Windows Server 2008 Datacenter Edition without Hyper-V, Server Core
13 0x0000000D Windows Server 2008 Standard Edition, Server Core
40 0x00000028 Windows Server 2008 Standard Edition without Hyper-V, Server Core
14 0x0000000E Windows Server 2008 Enterprise Edition, Server Core
41 0x00000029 Windows Server 2008 Enterprise Edition without Hyper-V, Server Core
29 0x0000001D Windows Web Server 2008, Server Core

I agree a couple of other dead give-aways exist (checking for the existence of oclist.exe or SCregEdit.wsf would suffice as well) but none of these are really decent...

    

Concluding

When determining whether a server is a Server Core remotely isn't as simply as typing a command and getting it served on a silver platter. You need to actually decipher a value using the table provided here.

What a pity this isn't easier...

Further Reading

GetProductInfo Function using wmic path win32_Operatingsystem get OperatingSystemSKU 
Windows Server 2008: Compare Server Core Installation Options 
Core flavors of Windows Server 2008 
MSDN Application Compatibility: Windows Server 2008 Server Core

Posted: Sunday, June 15, 2008 1:14 AM by Sander Berkouwer

Comments

Live PowerShell With Karl Prosser » Blog Archive » Portable PowerShell - v1 and v2 side by side - even on Server Core. said:

This screenshot shows Server Core Enterprise - you can verify this isn’t a trick but is indeed server core by the operatingsystemSKU of 14 shown in the top window. (MSDN reference. ) Server Core does not have dotnet 2.0 (a prerequisite of PowerShell) installed and we haven’t applied any cool hacks or Russian reverse engineering  to get it working therefore we haven’t compromised the secure state of our servercore by installing any untested potential lasting security hole on it. We purely XCOPY across our files, or we can even run it off a USB drive. Another great benefit you see here is on the same machine we are running PowerShell V1 and V2 side by side. How many of us have had to set up a whole new machine or VM just to play with V2 CTP!!!!! and how many cough*cough have installed v2 on a production machine when we should have for lack of patience in setting up a dedicated v2 test machine?

# June 17, 2008 9:47 PM
Anonymous comments are disabled