5 Replies Latest reply on Sep 5, 2019 10:16 AM by MikeimusPrime

    How to get Horizon pool details from PowerCLI

    rseekell Novice

      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

        • 1. Re: How to get Horizon pool details from PowerCLI
          LucD Guru
          User ModeratorsCommunity WarriorsvExpert

          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.

          1 person found this helpful
          • 2. Re: How to get Horizon pool details from PowerCLI
            rseekell Novice

            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

            • 3. Re: How to get Horizon pool details from PowerCLI
              agalliasistju Enthusiast

              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.

              • 4. Re: How to get Horizon pool details from PowerCLI
                agalliasistju Enthusiast

                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
                  MikeimusPrime Lurker

                  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.