類別SMS_Collection中的 AddMembershipRules 方法
在 AddMembershipRules
Configuration Manager 中, (WMI) 類別方法會將多個新規則新增至 CollectionRules
SMS_Collection Server WMI Class物件的 屬性。
下列語法是從受控物件格式 (MOF) 程式碼中簡化,並定義 方法。
語法
SInt32 AddMembershipRules(
SMS_CollectionRule collectionRules[],
UInt32 QueryIDs[]
);
參數
collectionRules
資料類型: SMS_CollectionRule
陣列
限定詞:[in]
SMS_CollectionRule要加入的伺服器 WMI 類別 物件。
QueryIDs
資料類型: UInt32
陣列
限定詞:[out]
對應至規則的識別碼。 這些是查詢規則Configuration Manager產生的查詢識別碼。 直接規則的識別碼設定為 0。 使用 QueryID
來修改或刪除查詢成員資格規則。
傳回值
資料 SInt32
類型,為 0 表示成功或非零表示失敗。
如需處理傳回錯誤的相關資訊,請參閱關於Configuration Manager錯誤。
註解
方法 AddMembershipRules
不會驗證查詢規則,而只會將它新增至規則清單。 當集合不包含預期的成員資格時,這可能會造成偵錯問題。 您的應用程式應該一律先驗證查詢規則,再使用 類別SMS_CollectionRuleQuery中的 ValidateQuery 方法,將它新增至集合規則。
方法 AddMembershipRules
也可以用來修改成員資格規則。 只能修改查詢規則。
需求
執行時間需求
如需詳細資訊,請參閱Configuration Manager伺服器執行時間需求。
開發需求
如需詳細資訊,請參閱Configuration Manager伺服器開發需求。