Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am wondering if there is a way to find VM's (esx's, datastore's, folder's, pool's and etc.) ID by name from vSphere Power CLI.

The goal is to find ID of VM if name if known (and the same for esx, datastore, folder, pool and etc.).

Thanks, Olegarr

share|improve this question

Have you looked at the powercli command reference (Clicky)? It's very straightforward, I'm not entirely clear exactly what you're trying to achieve but more than likely it's the get-vm commmandlet tree you'll be looking at.

share|improve this answer

Agree with Chopper3.

Use PowerCLI and the following commands:


Connect-VIserver <your VC/ESX host>

List all VMs and export to CSV file:

Get-VM | export-csv <filename>

Then, just replace Get-VM with Get-VMhost, get-datastore, get-folder, get-resourcepool, etc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.