VMware Cloud Community
sandeep15
Contributor
Contributor

How to get datacenter folder information of a specified virtual machine

Hi all,

can any one help me with how to get virtual machine data center folder ??

Thanks in advance.

0 Kudos
1 Reply
tschoergez
Leadership
Leadership

vm.parent gives the VM Folder (in VirtualMachines & Templates view in vsphere client) of the VM, from there you can traverse upwards using .parent to get the full tree back to the datacenter level.

0 Kudos