2

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

2 Answers2

2

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.

Chopper3
  • 101,299
  • 9
  • 108
  • 239
1

Agree with Chopper3.

Use PowerCLI and the following commands:

Connect:

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.

JakeRobinson
  • 2,904
  • 18
  • 26