类 SMS_Identification 中的 GetProviderVersion 方法

GetProviderVersion Configuration Manager,Windows Management Instrumentation (WMI) 类方法从 SMS 提供程序 DLL 的版本资源中获取产品版本字符串。

以下语法从托管对象格式简化 (MOF) 代码,并定义了方法。

语法

SInt32 GetProviderVersion(
      String VersionString
);

参数

VersionString 类型: String

限定符:[out]

Smsprov.dll 文件的版本资源中的产品版本字符串。

返回值

SInt32数据类型为 0 表示成功,非零表示失败。

有关处理返回的错误的信息,请参阅关于 Configuration Manager 错误。

备注

通过此方法获取的版本,你的应用程序可以确定 SMS 提供程序是否应用了修补程序。

示例代码

以下示例显示如何调用此方法来获取 SMS 提供程序的版本号。

Dim Identification As SWbemObject
Dim ProviderVersion As String

Set Identification = GetObject("winmgmts:\root\sms\site_<sitecode>:SMS_Identification")
Identification.GetProviderVersion ProviderVersion

MsgBox "Version = " & ProviderVersion

要求

运行时要求

有关详细信息,请参阅 Configuration Manager 服务器运行时要求。

开发要求

有关详细信息,请参阅 Configuration Manager 服务器开发要求。

另请参阅

SMS_Identification服务器 WMI 类