FillDeUK
Contributor
Contributor

PowerCLi - managing licences

Guys,

Anybody know how to get and modify this VC Licence field in PowerCLI? I can't even find it in the MOB. Is it just a DB entry in VC maybe?....

pastedImage_0.png

0 Kudos
3 Replies
jpsider
Expert
Expert

Invoke-Automation/add_license.ps1 at master · jpsider/Invoke-Automation · GitHub

$MyVC = $DefaultVIServer
$LicenseManager = get-view ($MyVC.ExtensionData.content.LicenseManager)
$LicenseManager.AddLicense($VC_LIC,$null)
$LicenseAssignmentManager = get-view ($LicenseManager.licenseAssignmentManager)
$LicenseAssignmentManager.UpdateAssignedLicense($MyVC.InstanceUuid,$VC_LIC,$Null)

check out Brian's post too:

https://www.brianjgraf.com/2014/06/10/adding-license-keys-vcenter-powercli/

0 Kudos
FillDeUK
Contributor
Contributor

Looking at your code, it seems to update the licence applied to the vCenter with a new one. My question was how to modify the "License" field highlighted yellow in the screen shot.

This does not seem to be availble anywhere in the API that I can find.

0 Kudos
jpsider
Expert
Expert

Ah, sorry. This is what I get for not reading the entire question. 

What exactly do you want to edit?

Let me get back to you.

0 Kudos