Hello guys,
I would like to implement on our environment a dashboard using htm page showing a search box for virtual machine, host & datastore.
This will help us showing info of the object searched.
Is this possible?
You could take a look at my vSphere Object by Path post.
It takes a path to an object (which would come from a treeview in your app) and returns the vSphere object, which will give you access to all properties for that object.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi LucD
Basically, my expected output is the details of VM I searched. Like what Search My VM tool does before, it sends back VM vcenter, datacenter, cluster, config, host, vmx location, datastore.
Not sure what you mean by 'config'.
For the others, try something like this
$vmName = 'MyVM'
Get-VM -Name $vmName |
Select Name,
@{N='vCenter';E={$_.Uid.Split(“:”)[0].Split(“@”)[1]}},
@{N='Datacenter';E={Get-Datacenter -VM $_ | select -ExpandProperty Name}},
@{N='Cluster';E={Get-Cluster -VM $_ | select -ExpandProperty Name}},
@{N='Host';E={$_.VMHost.Name}},
@{N='VMX';E={$_.ExtensionData.Config.Files.VmPathName}},
@{N='Datastore';E={(Get-View -Id $_.ExtensionData.Datastore -Property Name | Select -ExpandProperty Name) -join '|'}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Bernz,
Even i too looking for the same. By any chance did your requirement completed ?
Find-VM - locate a VM in multiple vCenter installations - Script Center - Spiceworks
Look what I have found.