Msvm_ReplicationService::GetReplicationStatisticsEx方法需要两个参数:
[in] CIM_ComputerSystem ComputerSystem,
[in] string ReplicationRelationship,
ReplicationRelationship是一个对象,所以我不知道为什么它需要它作为字符串。 文档说:
“ReplicationRelationship [in] Msvm_ReplicationRelationship类的嵌入式实例的字符串表示形式,用于定义要为其检索复制统计信息的复制关系。”不知道这意味着什么!
当我传递以下内容时,我收到“无效参数”错误:
rel.ToString()
和
rel["InstanceID"].ToString()
有人知道如何实际调用此方法吗?
这是rel来自的地方:
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\virtualization\\v2", "SELECT * FROM Msvm_ReplicationRelationship");
foreach (ManagementObject rel in searcher.Get()) {
//string representation of rel required here
//At the moment, just looping through all relationships for simplicity
}