i've resolved the above error by changing the code as:
$str = "ASSOCIATORS OF {$cs->{Path_}->{Path}} WHERE resultClass = Msvm_KvpExchangeComponent";
$components = $wmi->ExecQuery($str);
Pregunta
I am not able to get result set when ASSOCIATORS are used in WMI query using perl script. Can someone please help on this?
$str = "ASSOCIATORS OF {($cs->Path_)->Path} WHERE resultClass = Msvm_KvpExchangeComponent";
$components = $wmi->ExecQuery($str); #Here I am not able to find $components
Solución 2
i've resolved the above error by changing the code as:
$str = "ASSOCIATORS OF {$cs->{Path_}->{Path}} WHERE resultClass = Msvm_KvpExchangeComponent";
$components = $wmi->ExecQuery($str);
Otros consejos
The way to query for KVP data in Server 2012 or 2012 R2 has changed versus how it was in Server 2008, so trying to use the root/virtualization WMI namespace will not work.
That link shows how the WMI has changed, and how you can query to get the right data.