I am trying to run this simple script
$srmApi = $srm.ExtensionData
$protectionGroups = $srmApi.Protection.ListProtectionGroups()
$protectionGroups | % {
$protectionGroup = $_
$protectionGroupInfo = $protectionGroup.GetInfo()
$protectedVms = $protectionGroup.ListAssociatedVms() ##Fails
$protectedVms | % { $_.Vm.UpdateViewData() }
$protectedVms | %{
$output = "" | select VmName, PgName
$output.VmName = $_.Vm.Name
$output.PgName = $protectionGroupInfo.Name
$output
}
}
However, I get the error -
Exception calling "ListAssociatedVms" with "0" argument(s): "The operation is not supported on the object."
+ $protectionGroups[0].ListAssociatedVms <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
The ListAssociatedVms method does exist as piping $protectionGroups[0] | gm shows it as a valid method.
Any ideas?
We are using vSphere Server 5.0.0 with PowerCli 5.5
Thanks in advance,
Jake