Can someone help me with script to Export License usage report from Vcenter. This is done manually by logging into webclient> Licensing> reports> products > Export License Usage Report > .
Hi @LucD , How can I export these licenses details please . I tried to put | export-csv $outputpath but its not collecting the details.
please can you help me .
Works for me
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
HI LucD,
I receive the following error on line 3 ($LicenseAssignmentManager.GetType().GetMethod("QueryAssignedLicenses").Invoke($LicenseAssignmentManager,@($null)) |), when I try executing the script . It says I cant use "null"
Did the first 2 lines produce any errors?
Is there anything in $LicenseAssignmentManager?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Nope,, It doesn't , however, in the 3rd line also , it gave me an error for $LicenseAssignmentManager and I cant use "null" expressions or variables
Can you be more specific, perhaps add a screenshot?
Did you check the content of $LicenseAssignmentManager?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Please find the screenshot for you reference. Am new to the powercli scripting, I dont know if am doing something wrong
Can you just type $LicenseAssignmentManager at the command prompt, and check what it returns?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Here you go .
Ok, I know what happened.
You have multiple vCenter connections open.
You can check with displaying $global:defaultVIServers.
Close all those connections with
Disconnect-VIServer -Server * -Force -Confirm:$false
Then run that code again.
But perhaps add a Disconnect-VIServer at the end of the script to avoid the same issue on a 2nd or subsequent run of the script
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference