Question: Before we had the VCSA (Vcenter Server Appliance) we had a Windows Vcenter Server.

We had the PowerCLI installed locally.

There, we could say 

```
Get-VM -Name * | Sort-Object | %{
....

```

to get a list of all VMs registered in Vcenter.

---

Now we have the Appliance.

I installed the vMA (management assistant) too.

I registered the vcenter appliance, I am successfully connected to it, but I am unable to simply retrieve a list of VMs like above.

It always wants me to connect to a single ESXi host to perform a listing.

Now to me that seems like a step backward.

How would you do this?

Would you use vMA at all? Maybe use vCLI? Or stick with PowerCLI, but then I would need again to install a Windows machine just to run my scripts.....

Answer: 
I'd use a Windows PC or Server with PowerCLI installed... PowerCLI is where the momentum is with VMware, so the expectation is that you'll have a Windows system available to interface with it.

So while it's possible to install VMware without a Windows dependency, it turns out that Windows is actually a dependency :)

You could also use the [vCenter API](https://www.vmware.com/support/pubs/sdk_pubs.html), depending on what you're planning to do with the list of virtual machines...

Also see: [Is it possible to deploy VMware vSphere 5.5 without Windows?](https://serverfault.com/questions/627277/is-it-possible-to-deploy-vmware-vsphere-5-5-without-windows)
There is another solution: you can simply access the **vCenter DB directly** for this kind of stuff.

For reference, here is a one-liner that can be executed directly on the VCSA using the postgres client:

> 
> /opt/vmware/vpostgres/1.0/bin/psql --pset pager=off --pset footer=off
>  --command 'SELECT name FROM vpx\_vm\_config\_info ORDER BY name;' -U vc VCDB | tail -n +3 | head -n -1 | sed 's/^[ ]\*//g'
> 
> 
> 

I'm using head, tail and sed to filter out nasty headers, empty lines and spaces at the beginning of the line respectively. Maybe there is a more elegant and shorter way to do that, but I don't care.

Pros:

* No extra VM (vMA) necessary to obtain a list of VMs.
* Fast.

Cons: 

* Somewhat hacky.
* And probably very unsupported.