Updating The VMware VCenter License Key Using PowerCLI
Có thể bạn quan tâm
Out of the blue this week, I had a query from a colleague about being able to update the vCenter License key programmatically via PowerShell/PowerCLI. This is something I have done before so luckily I had a script.
The main license update component is here:
$LM = get-view($vCenter.ExtensionData.content.LicenseManager) $LM.AddLicense($vCenter6License,$null) $LAM = get-view($LicenseManager.licenseAssignmentManager) $LAM.UpdateAssignedLicense($vCenter.InstanceUuid,$vCenter6License,$Null) Note: This is not an original script, I found the original script online somewhere. So I definitely do not take the credit!For a fully working script we can top and tail the above code with the usual variable and connectivity statements for vCenter:
$vCenterServer=[vCenter FQDN] $User=[vCenter Username] $Password=[vCenter Password] $License = [vCenter License Key] $EncryptedPassword = ConvertTo-SecureString -String "$Password" -AsPlainText -Force` $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User, $EncryptedPassword` Disconnect-VIServer -confirm:$false -ErrorAction SilentlyContinue Write-Host "Connecting to $vCenterServer" $vCenter = Connect-VIServer -Server $vCenterServer -Credential $Credential $LM = get-view($vCenter.ExtensionData.content.LicenseManager) $LM.AddLicense($License,$null) $LAM = get-view($LicenseManager.licenseAssignmentManager) $LAM.UpdateAssignedLicense($vCenter.InstanceUuid,$License,$Null)And hey presto!
The script can also be found in my PowerShell github repo.
Note:If you are running PowerShell Core and trying to use the Connect-VIServer command then you may get the following error:
<figure class="blog"> <a href="/images/2019/06/14/screenshot.png"> <img src="/images/2019/06/14/screenshot.png" /> </a> </figure>If this is the case, you may need to run the following additional PowerCLI command enable this functionality to work:
Set-PowerCLIConfiguration -InvalidCertificateAction:IgnoreOnce that change has been made, the script should work.
If it doesn’t please let me know via social media!
Từ khóa » View Vcenter License Key Command Line
-
Solved: Command To Get License Key Information Of A Host
-
Vcenter 6.0 Is Not Working. Need Help In Retrieving License Key From ...
-
Learn How To License VCenter, ESXi And VSAN - Altaro
-
Managing VMware VCenter & ESXi License Keys With PowerCLI
-
Vcenter_license - Manage VMware VCenter License Keys
-
Powercli Get VCenter Licenses Information | VGeek - Virtual Geek
-
VCenter Licenses Test - EG Innovations
-
Vmware Vcenter Server Appliance License Key - Notion
-
Enabling VMware Licenses - IBM
-
Manage A License Key From The Command Line - BeyondTrust
-
VMware ESXi And VCenter Licensing In VMware VSphere - NAKIVO
-
Managing Licenses In The VSphere Web Client - YouTube
-
Assign A Key To VCenter "Server" With PowerCLI? : R/vmware - Reddit
-
Cisco Nexus 1000V Troubleshooting Guide, Release 4.0(4)SV1(3)