VMware Cloud Community
Ramvmwarefreak
Contributor
Contributor

Vmware powercli get-vm not retriving all registered VMs

Could somebody tell me that Why Get-vm not retrieving all Vms are which are registered with Vcenter ? This command gets only limited VMs.

0 Kudos
5 Replies
frostyk
Enthusiast
Enthusiast

Possibly, you do not have permissions to view the VMs on that vCenter?  Are you using the same account to run the script that has permissions to view them in the client?

0 Kudos
Ramvmwarefreak
Contributor
Contributor

1.My system is connected to domain and am domain admin  Hence no issues with the  permission.

2.If I login into a different machine than my VC, and try to run the command like get-vm fq1* , it will fetch the VMs which start with fq1 name . But in VC just appearing to the next line and no output, no error messages.

3. Even get-vm command does not retrieve full Vms list if I directly login into Vcenter and try it with the powercli which is installed inside Vcenter server.

Note that I have tried these steps after establishing connection with vcenter.

Please let me know if you have come across this situation and not sure if this could be a problem with .Net .

0 Kudos
frostyk
Enthusiast
Enthusiast

Keep in mind that your domain admin account permissions has nothing to do with your permissions within vcenter.  vCentrer doesn't care if you are a domain admin unless you tell it to.  If the Domain Admins group in your domain is granted gobal admin rights from within vCenter, then you should be fine on permissions.

When you do the Connect-VIserver command the account you use to connect there needs permissions within vcenter to view all of the VMs.  If its not prompting you for credentials its probably using whatever account you are logged into that VM with to establish the connection to vCenter.  I'm assuming here that your vCenter is joined to a domain and that domain is an identity source.  

0 Kudos
athomic42
Contributor
Contributor

Hi, I am running into a similar issue. I successfully log into vcenter via powercli. But when I run the get-vm command. It returns me a couple of the VMs hosted on the vcenter. (like 5 results when there are hundreds of VMs hosted there).

I am using the exact same account I use to connect to the VCenter gui client directly. And I can see all the VMs there. 

Any thoughts?
Thanks in advance

0 Kudos
LucD
Leadership
Leadership

Did you try with the administrator account?


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

0 Kudos