I found it, you should use the Win32_ServerFeature class ( http://msdn.microsoft.com/en-us/library/cc280268(VS.85).aspx ) and System.Management.ManagementClass. It works on ws2008.
ManagementClass objMC = new ManagementClass( "Win32_ServerFeature"); ManagementObjectCollection objMOC = objMC.GetInstances(); foreach (ManagementObject objMO in objMOC) { string featureName = (string)objMO.Properties["Name"].Value; }
source share