4 Replies Latest reply on Nov 21, 2018 8:53 AM by LucD

    PowerCLI - License label update

    Domesenn Lurker

      Hi All,

       

      I'm new member so thanks in advance for your help for my little problem .

       

      I have do a PowerCLI script that add a host license in the connect VC and put this in one host, the list of license key and hosts are in the file lic.txt and hosts.txt. This the code:

       

      $MyVC=Connect-VIServer -Server 192.168.100.10 -User administrator@vsphere.local -Password *************

       

      $LicenseManager = get-view ($MyVC.ExtensionData.content.LicenseManager)

      $LicKey = Get-Content C:\Script\lic.txt
      $ESXiHost = Get-Content C:\Script\hosts.txt

       

      foreach($row in $ESXiHost) {
         
          $LicenseManager.AddLicense($LicKey,$null)
          Set-VMHost -VMHost $ESXiHost -LicenseKey $LicKey

       


      }

      Disconnect-VIServer -Server * -Force -Confirm:$false

       

      All works fine but I need to change the label on column "License" from "License 1" to "host_name", there is some way to do this?

       

      Domesenn