類別 SMS_Identification 中的 GetProviderVersion 方法

在 Configuration Manager 中,GetProviderVersionWindows Management Instrumentation (WMI) 類別方法從 SMS 提供者 DLL 的版本資源取得產品版本字串。

下列語法是從 [受控物件格式] 簡化而 (MOF) 程式碼,並定義方法。

語法

SInt32 GetProviderVersion(
      String VersionString
);

參數

VersionString 資料類型: String

資格賽:[出局]

產品版本字串,來自 Smsprov.dll 檔案的版本資源。

傳回值

SInt32資料類型為 0 表示成功,非零表示失敗。

如需處理傳回錯誤的相關資訊,請參閱 關於 Configuration Manager 錯誤。

註解

此方法取得的版本可讓您的應用程式判斷 SMS 提供者是否已套用 Hotfix。

範例程式碼

下列範例示範如何呼叫此方法以取得 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 Server WMI 類別