VMware Cloud Community
jvm2016
Hot Shot
Hot Shot
Jump to solution

powercli:exception has been thrown by the target of an invocation

Hi Luc,

got following error while getting vmlist from cluster

pastedImage_0.png

can you please suggest something on above .

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

When you leave out the Location parameter, are the VMs on that cluster returned?

This looks similar to the issue in Get-VM Exception has been thrown by the target of an invocation.

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
14 Replies
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Can you try Get-Cluster <Clustername> | get-vm

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Do you also get the same exception when you

Get-VM -Location $cluster


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

yes it gave me same result .

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

thnaksfor replying but this also does not work.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

When you leave out the Location parameter, are the VMs on that cluster returned?

This looks similar to the issue in Get-VM Exception has been thrown by the target of an invocation.

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

tx ,i am checking this .

0 Kudos
jvm2016
Hot Shot
Hot Shot
Jump to solution

i checked on different vmwhere powercli 11.2 was installed .and i dont get this error now .

thnaks for this.

0 Kudos
MYL1
Contributor
Contributor
Jump to solution

I am also facing the same issue. Get-vm is working fine for other vms created by cloning from the base machine. If i create a vm by template then it is not working. What could be the reason for this ?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Did you try completely removing PowerCLI and reinstalling it?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
MYL1
Contributor
Contributor
Jump to solution

mine is a new system and i recently installed powercli 6.5

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Any reason why you using this old version 6.5?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
MYL1
Contributor
Contributor
Jump to solution

i removed 6.5 and installed 12.3 version.

Now Get-vm is working fine. But new-vm retuns some permission issue which was working fine with 6.5

new-vm : 26/01/2022 16:21:29 New-VM Permission to perform this operation was denied. Required privilege 'System.Read'

 

0 Kudos
LucD
Leadership
Leadership
Jump to solution

That is hidden permission which everyone needs to access the vCenter hierarchy.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
satheeshsatz
Enthusiast
Enthusiast
Jump to solution

Hi LuCD, 

am facing same issue. But, this is not happening to most of the ESXi, only to perticular ESXi host's VMs list iam not able to pull.

is there something related to port or any restriction to get the data? 

Get-VM Exception has been thrown by the target of an
invocation.

Regards, Satheesh
0 Kudos