Automation

 View Only
  • 1.  How to get Horizon pool details from PowerCLI

    Posted Apr 21, 2017 03:09 PM

    I would like to run a PowerShell command to get a lot of details from all the pools on one screen.  On my previous post, he recommended a cmdlet called get-pool. However, on this latest CLI download: Download VMware PowerCLI 6.5 Release 1, there does not seem to be a get-pool available.  Did I download the wrong thing? 

    Command to Display the pools with selected fields in table form:

    Get-pool | select DisplayName,Pool_ID,Enabled,MinimumCount,MaximumCount,HeadroomCount,Persistence,Pooltype,Protocol | FT -AutoSize



  • 2.  RE: How to get Horizon pool details from PowerCLI
    Best Answer

    Posted Apr 21, 2017 05:00 PM

    The Get-Pool cmdlet was present in the old View module.

    In the more recent PowerCLI releases, the new HorizonView module gives you an interface to the Horizon View environment.

    See Automating VMware Horizon 7 with VMware PowerCLI 6.5 for a quick intro.

    Note that the VMware.VimAutomation.HorizonView module itself only has 3 cmdlets in there.

    But the Horizon View people created a "helper" module, which wrapped several of the View API method in a function.

    See the VMware.HV.Helper module (also mentioned in the blog post above).

    And in that Helper module you will find functions like Get-HVPool, Get-HVPoolSummary...
    Those are the ones you're probably looking for.



  • 3.  RE: How to get Horizon pool details from PowerCLI

    Posted Apr 21, 2017 08:33 PM

    Thank you! This is what I'm trying to find.

    However, when I try to get the Current Image (parent and snapshot names) or Cluster of a pool, then it comes out as this crazy long ID string, and I cannot match it to anything in my vCenter.  How would I get the name of the parent, snapshot, and cluster that a pool uses?

    Example:

    $pool000 = get-hvpool -PoolName VMH-10x64-IC

    $pool000.AutomatedDesktopData.VirtualCenterProvisioningSettings.VirtualCenterProvisioningData.HostOrCluster



  • 4.  RE: How to get Horizon pool details from PowerCLI

    Posted Jul 01, 2019 03:32 PM

    rseekell​ did you ever get what you were looking for?  Specifically the name of the parent VM and the Snapshot name?  I'm also trying to get this info.



  • 5.  RE: How to get Horizon pool details from PowerCLI

    Posted Jul 01, 2019 03:41 PM

    rseekell​ did you ever get what you were looking for?  Specifically the name of the parent VM and the Snapshot name?  I'm also trying to get this info.



  • 6.  RE: How to get Horizon pool details from PowerCLI

    Posted Sep 05, 2019 05:14 PM

    I can help with this, there might be other ways, but here's what I use to get this info

    $pool = Get-HVPool -PoolName <Name>

    This will get you the path of the gold image

    $pool.AutomatedDesktopData.VirtualCenterNamesData.ParentVmPath

    This will get you the path to the snapshot

    $pool.AutomatedDesktopData.VirtualCenterNamesData.SnapshotPath

    Now, if you just want the currently in use snapshot and parent VM (and don't want the full path), you can do the following

    $pool.AutomatedDesktopData.VirtualCenterNamesData.ParentVmPath.substring(($pool.AutomatedDesktopData.VirtualCenterNamesData.ParentVmPath.LastIndexOf("/")+1))

    $pool.AutomatedDesktopData.VirtualCenterNamesData.SnapshotPath.substring(($pool.AutomatedDesktopData.VirtualCenterNamesData.SnapshotPath.LastIndexOf("/")+1))

    That will trim everything before (and including) the last '/' in the path.



  • 7.  RE: How to get Horizon pool details from PowerCLI

    Posted Jul 15, 2020 04:00 PM

    This will get you the path of the gold image

    $pool.AutomatedDesktopData.VirtualCenterNamesData.ParentVmPath

    This is the info I needed. Thanks!



  • 8.  RE: How to get Horizon pool details from PowerCLI

    Posted Jul 28, 2020 04:05 PM

    Is there a way to get this info per desktop? For example, if I want to check across all my pools and ensure all desktops received the intended image?



  • 9.  RE: How to get Horizon pool details from PowerCLI

    Posted Aug 27, 2020 02:50 PM

    Did you find a solution?