you can check the reading of the value in the registry
HKEY_LOCAL_MACHINE\Software\Microsoft\InetStp\Components\WMICompatibility
or you can output the contents of servermanagercmd to an xml file and parse this file that is looking for the iis6 compatibility component
ServerManagerCmd -query [SaveFile.xml]
If you do this on R2, servermanagercmd is now deprecated, so you can use powershell to achieve the same check. Here are some examples of powershell, in this case remotely http://www.techmumbojumblog.com/?p=217
WMI , , , , IIS, , .
btw, , , , #, , wmi iis6, - (-, ), - api, iis7, Microsoft.Web.Administration.dll System32\inetsrv.
using Microsoft.Web.Administration;