2 Replies Latest reply on Aug 8, 2019 11:21 PM by ganapa2000

    Cluster Name shows blank

    ganapa2000 Hot Shot

      Hi,

       

      I am not able to get the cluster name from the below script, please help

       

      Get-VMHost | Get-VirtualPortGroup -Name "VM Network 3011" | select @{N='Cluster';E={get-cluster -Name $_}}, @{N='VMHost';E={get-vmhost -id $_.VMhostid}}, @{N='PortGroup_Name';E={$_.Name}}, VirtualSwitch, VLanID

        • 1. Re: Cluster Name shows blank
          LucD Guru
          User ModeratorsvExpertCommunity Warriors

          Try like this.
          It requires PS v4 or higher.

           

          Get-VMHost -PipelineVariable esx | Get-VirtualPortGroup -Name "VM Network 3011" |

          select @{N='Cluster';E={(Get-Cluster -VMHost $esx).Name}},

             @{N='VMHost';E={$esx.Name}},

             @{N='PortGroup_Name';E={$_.Name}},

            VirtualSwitch, VLanID

           

          ---------------------------------------------------------------------------------------------------------

           

          Was it helpful? Let us know by completing this short survey here.

           

           

          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 2. Re: Cluster Name shows blank
            ganapa2000 Hot Shot

            That was quick, Thank you very much