With Hyper-Threading enabled you get 2 logical processors per core. Since VMM cares only about the number of logical processors I doubt you'll be able to get "lower level" CPU information out of it. To get the actual number of cores for each CPU you have to query the processor information via WMI:
Get-WmiObject Win32_Processor -Computer HOST01 |
select Name, NumberOfCores, NumberOfLogicalProcessors
Edit: In a situation where user and host have no access at all to the hypervisors I don't think you'll be able to obtain that information. Not without making some changes to the infrastructure, that is. The following might provide a viable approach, if you have someone who can set it up on the VMM host for you.
Periodically collect the information from the hypervisors with a scheduled task running the following script on the VMM host:
$datafile = 'C:\path\to\data.csv' $hypervisors = Get-SCVMHost | select -Expand Name Get-WmiObject Win32_Processor -Computer $hypervisors | select Name, NumberOfCores | Export-Csv $datafile -NoType -Encoding ASCII
Publish the content of the datafile with a custom web server on the VMM host:
$port = 8000 $datafile = 'C:\path\to\data.csv' $lastUpdate = Get-Date 0 $data = '' function Get-Data { $filedate = (Get-Item $datafile).LastWriteTime if ($filedate -gt $lastUpdate) { $script:data = Import-Csv 'C:\Temp\text.csv' | ConvertTo-Json $script:lastUpdate = $filedate } $script:data } If (-not (Test-Path -LiteralPath $datafile)) { New-Item -ItemType File -Path $datafile | Out-Null } $listener = New-Object Net.HttpListener $listener.Prefixes.Add("http://+:$port/") $listener.Start() while ($listener.IsListening) { $response = $listener.GetContext().Response $response.Headers.Add('Content-Type', 'text/plain') $buffer = [Text.Encoding]::ASCII.GetBytes((Get-Data)) $response.ContentLength64 = $buffer.Length $response.OutputStream.Write($buffer, 0, $buffer.Length) $response.Close() } $listener.Stop()
If the Windows Firewall is enabled on the VMM host you need to open the listener port in it.
With that in place you can access the data from a server or workstation like this:
Invoke-WebRequest 'http://vmmserver:8000/' | select -Expand Content |
ConvertFrom-Json