類別 SMS_SoftwareUpdate 中的 SetEnforcement 方法

在 Configuration Manager 中,SetEnforcementWindows Management Instrumentation (WMI) 類別方法會設定軟體更新的原則強制執行。

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

語法

SInt32 SetEnforcement(
     Boolean Enforced,
     DateTime EffectiveDate
);

參數

Enforced 資料類型: Boolean

限定詞:[in]

true 是否為設定項目啟用原則強制執行。

EffectiveDate 資料類型: DateTime

限定詞:[in]

設定項目符合規範的日期和時間,以國際標準時間 (UTC) 表示。

傳回值

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

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

需求

執行階段需求

如需詳細資訊,請參閱 Configuration Manager 伺服器執行階段需求。

開發需求

如需詳細資訊,請參閱 Configuration Manager 伺服器開發需求。

另請參閱

SMS_SoftwareUpdate Server WMI 類別