Comments (13)
Hey @EloiseJory,
Thanks for logging the issue. Can you post a screenshot of the console just so we can confirm exactly where it is failing? Please obviously feel free to obfuscate any sensitive information like server names.
What licenses do you have in this environment?
What privileges does the account have that you are running the script as?
Can you try loading the function below, and then after connecting to the vCenter Server with Connect-VIServer, please run the below and report back on what the output is:
Get-License -vCenter vcenter.fqdn.com
Get-License -Licenses
function Get-License {
<#
.SYNOPSIS
Function to retrieve vSphere product licensing information.
.DESCRIPTION
Function to retrieve vSphere product licensing information.
.NOTES
Version: 0.1.2
Author: Tim Carman
Twitter: @tpcarman
Github: tpcarman
.PARAMETER VMHost
A vSphere ESXi Host object
.PARAMETER vCenter
A vSphere vCenter Server object
.PARAMETER Licenses
All vSphere product licenses
.INPUTS
System.Management.Automation.PSObject.
.OUTPUTS
System.Management.Automation.PSObject.
.EXAMPLE
PS> Get-License -VMHost ESXi01
.EXAMPLE
PS> Get-License -vCenter VCSA
.EXAMPLE
PS> Get-License -Licenses
#>
[CmdletBinding()][OutputType('System.Management.Automation.PSObject')]
Param
(
[Parameter(Mandatory = $false, ValueFromPipeline = $false)]
[ValidateNotNullOrEmpty()]
[PSObject]$vCenter,
[PSObject]$VMHost,
[Parameter(Mandatory = $false, ValueFromPipeline = $false)]
[Switch]$Licenses
)
$LicenseObject = @()
$ServiceInstance = Get-View ServiceInstance -Server $vCenter
$LicenseManager = Get-View $ServiceInstance.Content.LicenseManager -Server $vCenter
$LicenseManagerAssign = Get-View $LicenseManager.LicenseAssignmentManager -Server $vCenter
if ($VMHost) {
$VMHostId = $VMHost.Extensiondata.Config.Host.Value
$VMHostAssignedLicense = $LicenseManagerAssign.QueryAssignedLicenses($VMHostId)
$VMHostLicense = $VMHostAssignedLicense.AssignedLicense
if ($VMHostLicense.LicenseKey -and $Options.ShowLicenseKeys) {
$VMHostLicenseKey = $VMHostLicense.LicenseKey
} else {
$VMHostLicenseKey = "*****-*****-*****" + $VMHostLicense.LicenseKey.Substring(17)
}
$LicenseObject = [PSCustomObject]@{
Product = $VMHostLicense.Name
LicenseKey = $VMHostLicenseKey
}
}
if ($vCenter) {
$vCenterAssignedLicense = $LicenseManagerAssign.GetType().GetMethod("QueryAssignedLicenses").Invoke($LicenseManagerAssign, @($_.MoRef.Value)) | Where-Object { $_.EntityID -eq $vCenter.InstanceUuid }
$vCenterLicense = $vCenterAssignedLicense.AssignedLicense
if ($vCenterLicense.LicenseKey -and $Options.ShowLicenseKeys) {
$vCenterLicenseKey = $vCenterLicense.LicenseKey
} else {
$vCenterLicenseKey = "*****-*****-*****" + $vCenterLicense.LicenseKey.Substring(17)
}
$LicenseObject = [PSCustomObject]@{
Product = $vCenterLicense.Name
LicenseKey = $vCenterLicenseKey
}
}
if ($Licenses) {
foreach ($License in $LicenseManager.Licenses) {
if ($Options.ShowLicenseKeys) {
$LicenseKey = $License.LicenseKey
} else {
$LicenseKey = "*****-*****-*****" + $License.LicenseKey.Substring(17)
}
$Object = [PSCustomObject]@{
'Product' = $License.Name
'LicenseKey' = $LicenseKey
'Total' = $License.Total
'Used' = $License.Used
}
$LicenseObject += $Object
}
}
Write-Output $LicenseObject
}
Cheers, Matt.
from asbuiltreport.vmware.vsphere.
from asbuiltreport.vmware.vsphere.
Hi @EloiseJory,
Can you try running the following please and sharing the output, while obfuscating the License Keys (please just replace charaters with "x" so we know there was output there.
$vcenter = "vCenterServerName"
Connect-VIServer $vcenter
$ServiceInstance = Get-View ServiceInstance -Server $vCenter
$LicenseManager = Get-View $ServiceInstance.Content.LicenseManager -Server $vCenter
$LicenseManager.Licenses
from asbuiltreport.vmware.vsphere.
LicenseKey : 00000-00000-00000-00000-00000
EditionKey : eval
Name : Product Evaluation
Total : 0
Used :
CostUnit :
Properties : {Localized}
Labels :
LicenseKey : xxxxxx
EditionKey : vc.standard.instance
Name : VMware vCenter Server 6 Standard
Total : 1
Used : 1
CostUnit : server
Properties : {LicenseInfo, ProductName, ProductVersion, FileVersion...}
Labels :
LicenseKey : xxxxxx
EditionKey : esx.enterprisePlus.cpuPackage
Name : VMware vSphere 6 Enterprise Plus
Total : 48
Used : 20
CostUnit : cpuPackage
Properties : {LicenseInfo, ProductName, ProductVersion, FileVersion...}
Labels :
LicenseKey : xxxxxxxx
EditionKey : vc.standard.instance
Name : VMware vCenter Server 6 Standard
Total : 1
Used : 1
CostUnit : server
Properties : {LicenseInfo, ProductName, ProductVersion, FileVersion...}
Labels :
from asbuiltreport.vmware.vsphere.
Hmm. And then these please (following on from the previous commands):
$LicenseManagerAssign = Get-View $LicenseManager.LicenseAssignmentManager -Server $vcenter
$LicenseManagerAssign.GetType().GetMethod("QueryAssignedLicenses").Invoke($LicenseManagerAssign, @($_.MoRef.Value))
from asbuiltreport.vmware.vsphere.
there are 2 vcenters in linked mode, however I've previously run the asbuilt report on them one at a time with no problem in 6.5 . This is the first attempt at a 6.7 as built report
PS H:> $LicenseManagerAssign = Get-View $LicenseManager.LicenseAssignmentManager -Server $vcenter
PS H:> $LicenseManagerAssign.GetType().GetMethod("QueryAssignedLicenses").Invoke($LicenseManagerAssign, @($_.MoRef.Valu
e))
EntityId : host-31
Scope : 2f63f088-a629-4d65-a524-fd2e9fd998b4
EntityDisplayName : host3
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
EntityId : host-34
Scope : 2f63f088-a629-4d65-a524-fd2e9fd998b4
EntityDisplayName : host4
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
EntityId : 2f63f088-a629-4d65-a524-fd2e9fd998b4
Scope :
EntityDisplayName : vcenter2
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
EntityId : host-31
Scope : 01ab82aa-4913-43a5-bfd9-a2f7470ac059
EntityDisplayName : host30
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
EntityId : host-531
Scope : 01ab82aa-4913-43a5-bfd9-a2f7470ac059
EntityDisplayName : host35
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
EntityId : host-1072
Scope : 01ab82aa-4913-43a5-bfd9-a2f7470ac059
EntityDisplayName : host36
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
EntityId : host-393
Scope : 01ab82aa-4913-43a5-bfd9-a2f7470ac059
EntityDisplayName : host32
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
EntityId : host-34
Scope : 01ab82aa-4913-43a5-bfd9-a2f7470ac059
EntityDisplayName : host31
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
EntityId : host-1065
Scope : 01ab82aa-4913-43a5-bfd9-a2f7470ac059
EntityDisplayName : host34
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
EntityId : host-1838
Scope : 01ab82aa-4913-43a5-bfd9-a2f7470ac059
EntityDisplayName : host37
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
EntityId : host-388
Scope : 01ab82aa-4913-43a5-bfd9-a2f7470ac059
EntityDisplayName : host33
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
EntityId : 01ab82aa-4913-43a5-bfd9-a2f7470ac059
Scope :
EntityDisplayName : vcenter2
AssignedLicense : VMware.Vim.LicenseManagerLicenseInfo
Properties : {ProductName, ProductVersion, FileVersion, CostUnit...}
PS H:>
from asbuiltreport.vmware.vsphere.
Thoughts @tpcarman?
from asbuiltreport.vmware.vsphere.
can I stop the licence part from running? comment out something?
from asbuiltreport.vmware.vsphere.
Is there a section I can comment out so the report will run without licencing info?
from asbuiltreport.vmware.vsphere.
@EloiseJory It's probably worth having a look at your environment and seeing what is happening first hand. Would that be possible? Can we arrange a screen sharing session at some stage?
from asbuiltreport.vmware.vsphere.
@tpcarman ill have to check with management and get back to you....
from asbuiltreport.vmware.vsphere.
@EloiseJory I believe I have identified the issue and looking to include the fix in the next update, due soon. Let me know if you wish to test before release.
from asbuiltreport.vmware.vsphere.
@EloiseJory I believe I have identified the issue and looking to include the fix in the next update, due soon. Let me know if you wish to test before release.
I can give it a test...
from asbuiltreport.vmware.vsphere.
Related Issues (20)
- SDRS VM Overrides shows empty "Virtual Machine" column while Cluster filtering is used
- Record the TPM State of each node and if encryption enabled, backup the keys of each node into the report HOT 4
- vCenter user privileges doesn't handle groups
- Exception calling "Substring" with "1" argument(s) HOT 6
- The underlying connection was closed: A connection that was expected to be kept alive was closed by the server HOT 2
- Issues with reporting of PCI Devices with VMware ESXi 8.0 hosts HOT 1
- Issues with reporting of vCenter Server Alarms in vSphere 8.0
- Missing vSAN information when running against vSphere 8.0 environment HOT 1
- IP address Report HOT 1
- Error in Image Profile section HOT 2
- Asbuilt for vSphere errors stops running HOT 2
- vSphere 8.0 U1c Build 22088981 - New-AsBuiltReport : Cannot bind argument to parameter 'Rows' because it is an empty collection. HOT 29
- vSAN 8 ESA - "VsanDiskGroup" is empty HOT 10
- Cannot Bind Argument to Parameter "Rows" because its is empty collection following PCI devices. HOT 1
- vSphere 8.0.2-22617221 - New-AsBuiltReport : Cannot bind argument to parameter 'Rows' because it is an empty collection. HOT 8
- Host Network Section - NSX-T virtual switch portgroup labels are erroneously associated with a VMKernel port HOT 2
- New-AsBuiltReport : Cannot bind argument to parameter 'Rows' because it is an empty collection. HOT 2
- option to remove "roles" from report
- Machine SSL certificate information not working using the vcenter IP address as -Target
- SDRS VM Overrides display duplicate VMs if the vCenter is connected by IP and FQDN
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asbuiltreport.vmware.vsphere.