Friday, June 17, 2011

How to retrieve VHosts in VDI Management Console via Powershell


As per the code written by us, the pscmdlet for this is:-

Get-VHost -VirtualPlatform -VirtualizationProductType

So one can use this to get the VHosts.
For VirtualPlatform, we have created a method which gives the list of all the available VirtualizationPlatform that can be used and one can create an object of it and use that object as a parameter passed to the commandlet.

Get-VirtualPlatform

Similarly, for VirtualizationProductType we have the method

Get-VirtualizationProductType

So combined, we can use these to get the list of VirtualHosts. One example is:-

$x=get-virtualplatforms
$y=get-virtualizationproducttype
$z=get-vhosts -VirtualPlatform $x[0] -VirtualizationProductType $y[0]
$z.listofVH



No comments:

Post a Comment