How to specify installed features of Windows Server 2008 in C #

How can I list all installed features of Windows Server 2008 in C #. I tried to request dism.exe or oclist.exe , but not all versions have it. Can I use System.Management.ManagementClass for this somehow?

+3
source share
1 answer

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; } 
+7
source

All Articles