Is it possible there is a bug in the executemethod function of iresultobject when used under vb.net?
'==============================
'add the rule to the collection
'==============================
Dim oNewRule As IResultObject = oWMI.CreateEmbeddedObjectInstance("SMS_CollectionRuleDirect")
oNewRule("ResourceClassName").StringValue = "SMS_R_UserGroup"
oNewRule("ResourceID").StringValue = <resourceID>
oNewRule("RuleName").StringValue = <groupname>
' Add the direct rule to the collection.
Dim oDictParameters As New Dictionary(Of String, Object)
oDictParameters.Add("SMS_CollectionRule", oNewRule)
oCollection = oWMI.GetInstance("SMS_Collection.CollectionID='" & strCollectionID & "'")
oCollection.ExecuteMethod("AddMembershipRule", oDictParameters)
I get the error:
10/29/2009 1:18:32 PM Error: Microsoft.ConfigurationManagement.ManagementProvider.WqlQueryEngine.WqlQueryException: Not found , Method = AddMembershipRule ---> System.Management.ManagementException: Not found
I know from the c# examples that this shoudl work, but it doesn't.