VMware Cloud Community
thiag2011
Enthusiast
Enthusiast
Jump to solution

Script to get number of CPU in evaluation mode.

Hi team,

I would like to know the total number of CPUs which is under evaluation mode. The script i created is as below.

$ServiceInstance = Get-View ServiceInstance

$Eval = (Get-View ($ServiceInstance | Select -First 1).Content.LicenseManager | select -ExpandProperty licenses | ? {$_.Name -match "Evaluation mode"}| select Used| Measure-Object -Property Used -sum).Sum

Write-host "$Eval"

Using this format, i got the license count of licensed CPUs, but unable to get for evaluation mode, Am not sure what is missing.

Can some one help me please.

Output required:

If there are 4 hosts with 2 CPU each running in evaluation mode , i need output as  "8"

Reply
0 Kudos
1 Solution

Accepted Solutions
thiag2011
Enthusiast
Enthusiast
Jump to solution

That was my mistake...

The correct entry is as below.

$ServiceInstance = Get-View ServiceInstance

$Eval = (Get-View ($ServiceInstance | Select -First 1).Content.LicenseManager | select -ExpandProperty licenses | ? {$_.Name -match "Product Evaluation"}| select Used| Measure-Object -Property Used -sum).Sum

Write-host "$Eval"

View solution in original post

Reply
0 Kudos
2 Replies
thiag2011
Enthusiast
Enthusiast
Jump to solution

Any help please....

Reply
0 Kudos
thiag2011
Enthusiast
Enthusiast
Jump to solution

That was my mistake...

The correct entry is as below.

$ServiceInstance = Get-View ServiceInstance

$Eval = (Get-View ($ServiceInstance | Select -First 1).Content.LicenseManager | select -ExpandProperty licenses | ? {$_.Name -match "Product Evaluation"}| select Used| Measure-Object -Property Used -sum).Sum

Write-host "$Eval"

Reply
0 Kudos