sql HWI EXT SQL Server产品。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql HWI EXT SQL Server产品。相关的知识,希望对你有一定的参考价值。

//=====================================================
//---------------| SQL extension start |---------------
//=====================================================

//-- Set default WMI namespace
#Pragma NameSpace("\\\\.\\ROOT\\cimv2")

//----------| Old SQL extension cleanup |---------

//-- !! UNCOMMENT TO ACTIVATE !! (Remove '//' from '//#Pragma')

//#Pragma DeleteClass("SQL_2017", NOFAIL)
//#Pragma DeleteClass("SQL_2016", NOFAIL)
//#Pragma DeleteClass("SQL_2014", NOFAIL)
//#Pragma DeleteClass("SQL_2012", NOFAIL)
//#Pragma DeleteClass("SQL_2008", NOFAIL)
//#Pragma DeleteClass("SQL_2000_And_2005", NOFAIL)

//---------------| SQL 2017 class |---------------

//-- Create custom WMI class
//-  Class qualifiers
[
    Description("The SQL_2017_Property class contains information about the SQL 2017 service. You can use this information for SQL version reporting."): ToInstance,
    UNION,
    ViewSources {
        "SELECT PropertyIndex, PropertyName, PropertyNumValue, PropertyStrValue, ServiceName, SqlServiceType FROM SqlServiceAdvancedProperty WHERE SQLServiceType=1"
    },
    ViewSpaces {
        "\\\\.\\ROOT\\Microsoft\\SqlServer\\ComputerManagement14"
    },
    Dynamic,
    Provider("MS_VIEW_INSTANCE_PROVIDER")
]
//-  Class properties
Class SQL_2017_Property
{
    [PropertySources{"PropertyIndex"},  key]    uint32 PropertyIndex;
    [PropertySources{"PropertyName"},   key]    string PropertyName;
    [PropertySources{"PropertyNumValue"}   ]    uint32 PropertyNumValue;
    [PropertySources{"PropertyStrValue"}   ]    string PropertyStrValue;
    [PropertySources{"ServiceName"},    key]    string ServiceName;
    [PropertySources{"SqlServiceType"}, key]    uint32 SqlServiceType;
};

//---------------| SQL 2016 class |---------------

//-- Create custom WMI class
//-  Class qualifiers
[
    Description("The SQL_2016_Property class contains information about the SQL 2016 service. You can use this information for SQL version reporting."): ToInstance,
    UNION,
    ViewSources {
        "SELECT PropertyIndex, PropertyName, PropertyNumValue, PropertyStrValue, ServiceName, SqlServiceType FROM SqlServiceAdvancedProperty WHERE SQLServiceType=1"
    },
    ViewSpaces {
        "\\\\.\\ROOT\\Microsoft\\SqlServer\\ComputerManagement13"
    },
    Dynamic,
    Provider("MS_VIEW_INSTANCE_PROVIDER")
]
//-  Class properties
Class SQL_2016_Property
{
    [PropertySources{"PropertyIndex"},  key]    uint32 PropertyIndex;
    [PropertySources{"PropertyName"},   key]    string PropertyName;
    [PropertySources{"PropertyNumValue"}   ]    uint32 PropertyNumValue;
    [PropertySources{"PropertyStrValue"}   ]    string PropertyStrValue;
    [PropertySources{"ServiceName"},    key]    string ServiceName;
    [PropertySources{"SqlServiceType"}, key]    uint32 SqlServiceType;
};

//---------------| SQL 2014 class |---------------

//-- Create custom WMI class
//-  Class qualifiers
[
    Description("The SQL_2014_Property class contains information about the SQL 2014 service. You can use this information for SQL version reporting."): ToInstance,
    UNION,
    ViewSources {
        "SELECT PropertyIndex, PropertyName, PropertyNumValue, PropertyStrValue, ServiceName, SqlServiceType FROM SqlServiceAdvancedProperty WHERE SQLServiceType=1"
    },
    ViewSpaces {
        "\\\\.\\ROOT\\Microsoft\\SqlServer\\ComputerManagement12"
    },
    Dynamic,
    Provider("MS_VIEW_INSTANCE_PROVIDER")
]
//-  Class properties
Class SQL_2014_Property
{
    [PropertySources{"PropertyIndex"},  key]    uint32 PropertyIndex;
    [PropertySources{"PropertyName"},   key]    string PropertyName;
    [PropertySources{"PropertyNumValue"}   ]    uint32 PropertyNumValue;
    [PropertySources{"PropertyStrValue"}   ]    string PropertyStrValue;
    [PropertySources{"ServiceName"},    key]    string ServiceName;
    [PropertySources{"SqlServiceType"}, key]    uint32 SqlServiceType;
};

//---------------| SQL 2012 class |---------------

//-- Create custom WMI class
//-  Class qualifiers
[
    Description("The SQL_2012_Property class contains information about the SQL 2012 service. You can use this information for SQL version reporting."): ToInstance,
    UNION,
    ViewSources {
        "SELECT PropertyIndex, PropertyName, PropertyNumValue, PropertyStrValue, ServiceName, SqlServiceType FROM SqlServiceAdvancedProperty WHERE SQLServiceType=1"
    },
    ViewSpaces {
        "\\\\.\\ROOT\\Microsoft\\SqlServer\\ComputerManagement11"
    },
    Dynamic,
    Provider("MS_VIEW_INSTANCE_PROVIDER")
]
//-  Class properties
Class SQL_2012_Property
{
    [PropertySources{"PropertyIndex"},  key]    uint32 PropertyIndex;
    [PropertySources{"PropertyName"},   key]    string PropertyName;
    [PropertySources{"PropertyNumValue"}   ]    uint32 PropertyNumValue;
    [PropertySources{"PropertyStrValue"}   ]    string PropertyStrValue;
    [PropertySources{"ServiceName"},    key]    string ServiceName;
    [PropertySources{"SqlServiceType"}, key]    uint32 SqlServiceType;
};

//---------------| SQL 2008 class |---------------

//-- Create custom WMI class
//-  Class qualifiers
[
    Description("The SQL_2008_Property class contains information about the SQL 2008 service. You can use this information for SQL version reporting."): ToInstance,
    UNION,
    ViewSources {
        "SELECT PropertyIndex, PropertyName, PropertyNumValue, PropertyStrValue, ServiceName, SqlServiceType FROM SqlServiceAdvancedProperty WHERE SQLServiceType=1"
    },
    ViewSpaces {
        "\\\\.\\ROOT\\Microsoft\\SqlServer\\ComputerManagement10"
    },
    Dynamic,
    Provider("MS_VIEW_INSTANCE_PROVIDER")
]
//-  Class properties
Class SQL_2008_Property
{
    [PropertySources{"PropertyIndex"},  key]    uint32 PropertyIndex;
    [PropertySources{"PropertyName"},   key]    string PropertyName;
    [PropertySources{"PropertyNumValue"}   ]    uint32 PropertyNumValue;
    [PropertySources{"PropertyStrValue"}   ]    string PropertyStrValue;
    [PropertySources{"ServiceName"},    key]    string ServiceName;
    [PropertySources{"SqlServiceType"}, key]    uint32 SqlServiceType;
};

//---------------| SQL 2000/2005 class |---------------

//-- Create custom WMI class
//-  Class qualifiers
[
    Description("The SQL_Legacy_Property class contains information about the SQL 2000 and 2005 service. You can use this information for SQL version reporting."): ToInstance,
    UNION,
    ViewSources {
        "SELECT PropertyIndex, PropertyName, PropertyNumValue, PropertyStrValue, ServiceName, SqlServiceType FROM SqlServiceAdvancedProperty WHERE SQLServiceType=1"
    },
    ViewSpaces {
        "\\\\.\\ROOT\\Microsoft\\SqlServer\\ComputerManagement"
    },
    Dynamic,
    Provider("MS_VIEW_INSTANCE_PROVIDER")
]
//-  Class properties
Class SQL_Legacy_Property
{
    [PropertySources{"PropertyIndex"},  key]    uint32 PropertyIndex;
    [PropertySources{"PropertyName"},   key]    string PropertyName;
    [PropertySources{"PropertyNumValue"}   ]    uint32 PropertyNumValue;
    [PropertySources{"PropertyStrValue"}   ]    string PropertyStrValue;
    [PropertySources{"ServiceName"},    key]    string ServiceName;
    [PropertySources{"SqlServiceType"}, key]    uint32 SqlServiceType;
};

//---------------| SQL ProductID class |---------------
#Pragma DeleteClass("SQL_ProductID", NOFAIL)

//-- Create custom WMI class
//-  Class qualifiers
    [
        Description("The SQL_ProductID class contains the obfuscated SQL license key. You can use this information for SQL reporting."): ToInstance
    ]

//-  Class properties
Class SQL_ProductID
{
    [key]
    string  Release;
    string  ProductID;
    boolean DigitalProductID[];
};

//- SQL 2017 class instance
[DYNPROPS]
Instance of SQL_ProductID
{
    Release = "2017";
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\140\\Tools\\ClientSetup|ProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    ProductID;
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\140\\Tools\\ClientSetup|DigitalProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    DigitalProductID;
};

//- SQL 2016 class instance
[DYNPROPS]
Instance of SQL_ProductID
{
    Release = "2016";
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\130\\Tools\\ClientSetup|ProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    ProductID;
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\130\\Tools\\ClientSetup|DigitalProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    DigitalProductID;
};

//- SQL 2014 class instance
[DYNPROPS]
Instance of SQL_ProductID
{
    Release = "2014";
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\120\\Tools\\Setup|ProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    ProductID;
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\120\\Tools\\Setup|DigitalProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    DigitalProductID;
};

//- SQL 2012 class instance
[DYNPROPS]
Instance of SQL_ProductID
{
    Release = "2012";
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\110\\Tools\\Setup|ProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    ProductID;
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\110\\Tools\\Setup|DigitalProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    DigitalProductID;
};

//- SQL 2008 class instance
[DYNPROPS]
Instance of SQL_ProductID
{
    Release = "2008";
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQL10\\Setup|ProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    ProductID;
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQL10\\Setup|DigitalProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    DigitalProductID;
};

//- SQL Legacy class instance
[DYNPROPS]
Instance of SQL_ProductID
{
    Release = "Legacy";
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\90\\ProductID|ProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    ProductID;
    [
        PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\90\\ProductID|DigitalProductID"),
        Dynamic,
        Provider("RegPropProv")
    ]
    DigitalProductID;
};

//=====================================================
//----------------| SQL extension end |----------------
//=====================================================

以上是关于sql HWI EXT SQL Server产品。的主要内容,如果未能解决你的问题,请参考以下文章

text HWI EXT Win32_EncryptableVolume_Ext.mof

text HWI EXT Win32Reg_BitlockerPolicy.mof

sql server产品密钥一定要填吗

sql server第三方产品

根据 SQL Server 中给定的条件分配产品名称

SQL Server SUM(添加)产品配件的价格