Domesenn
VMware Employee
VMware Employee

PowerCLI - License label update

Jump to solution

Hi All,

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

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?

pastedImage_0.png

Domesenn

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

Afaik, that is a private API, so you can't.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership

Afaik, that is a private API, so you can't.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
Domesenn
VMware Employee
VMware Employee

:smileycry::smileycry::smileycry:

Many thanks LucD

0 Kudos
Alma943
Contributor
Contributor

Hi LucD,

Can it be added to an future release of PowerCLI, as it would make it easier to automatically assign licenses, based on the the Label

br

A.Mikkelsen

0 Kudos
LucD
Leadership
Leadership

I'm not working for VMware and have nothing to say on roadmaps and future features.

But there is the PowerCLI Ideas website, and I noticed you already submitted the idea.

You have my vote :smileygrin:


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos