Windows Home Server 2011 has three product editions:
- Windows SBS 2011 Essentials incorporates best-of-breed 64-bit product technologies for data backup and restore, remote access, file and printer sharing, and quick connection to the cloud—in one fully integrated solution.
- Windows Home Server 2011 is the server platform that’s designed specifically for families and how they access their digital data. It helps to simplify and connect your family’s photos, videos, music, and TV by providing a familiar and easy way to share, store, stream, and automatically protect what’s most important. It supports up to 10 users.
- Windows Storage Server 2008 R2 Essentials is the ideal storage server solution to help home-based and small business owners keep important data automatically backed up, protected, organized, and accessible from virtually anywhere. Built on the Windows Server 2008 R2 operating system, it streamlines access to centralized files for up to 25 users.
If you are writing an addin and you want to know what version your addin is running on, then this simple class will be very helpful to you.
The way we retrieve this information is via the Windows API GetProductInfo:
private const int PRODUCT_HOME_SERVER = 0x22;
private const int PRODUCT_SB_SOLUTION_SERVER = 0x13;
private const int PRODUCT_HOME_PREMIUM_SERVER = 0x32;
[DllImport(“kernel32.dll”)]
private static extern bool GetProductInfo(int dwOSMajorVersion, int dwOSMinorVersion, int dwSpMajorVersion, int dwSpMinorVersion, outuint pdwReturnedProductType);
///<summary>
/// WHS Edition
///</summary>
public enum WHSEdition
{
///<summary>
/// Unknown Edition
///</summary>
Unknown = 0,
///<summary>
/// Windows Home Server 2011
///</summary>
Standard = 1,
///<summary>
/// Windows Small Business Server 2011 Essentials
///</summary>
SmallBusinessEssentials = 2,
///<summary>
/// Windows Storage Server 2008R2
///</summary>
StorageServer = 3
}
///<summary>
/// Retrieves the WHS Edition that the application is running on
///</summary>
///<returns>WHSEdition</returns>
public static WHSEdition GetWHSEdition()
{
uint pdwReturnedProductType;
GetProductInfo(Environment.OSVersion.Version.Major,
Environment.OSVersion.Version.Minor,
0,
0,
out pdwReturnedProductType);
switch (pdwReturnedProductType)
{
case PRODUCT_HOME_SERVER: return WHSEdition.Standard;
case PRODUCT_SB_SOLUTION_SERVER: return WHSEdition.StorageServer;
case PRODUCT_HOME_PREMIUM_SERVER: return WHSEdition.SmallBusinessEssentials;
default: return WHSEdition.Unknown;
}
}
You can download the class sourcefile here.