The attached Visual Basic 2008 solution is an example of how to use RetrieveProperties to p ull information from vCenter and populate a treeview with the results. Once populated, you can click on any folder and have the VMs in that folder populated into a grid with boottime displayed.
This project includes a VI.vb module that can easily be reused in other projects. It also includes partially optimized VimApi DLL files and a login form.
Known Issues:
- If more than one Datacenter is present in vCenter, it will throw an exception that is trapped and continue working with only the single datacenter displayed.
- If you click on anything other than a folder (datacenter for example) it will throw an error and not display the VMs
Screenshot of the populated project below:
If you want to turn it back on so that it shows VMs in the tree, you will need to:
- Uncomment Lines 188-191 in VI.vb (Create VM Property Spec)
- Uncomment Line 211 (setting propSet that includes the VMpSpec)
- Comment out Line 212 (setting propSet that Does NOT include the VMpSpec)