Get-ESXiMemoryDimms

by Grzegorz Kulikowski

I had to get some info about host memory dimms layout, so i wrote this one.
It is utilizing CIM_PhysicalMemory. Not sure if i haven’t written it before, but i couldn’t find it on my disk so…
Here it is.

[sourcecode language=”powershell”]
Function Get-ESXiMemoryDimms {
<#
.SYNOPSIS
Returns memory dimms configuration for esxi

.DESCRIPTION
This function utilizes wsman / cim in order to download configuration of memory dims in ESXi.

.PARAMETER esxi
Specify esxi host for which you want to get the report

.PARAMETER rootpw
Password for user root inside esxi

.EXAMPLE
PS C:\> Get-ESXiMemoryDimms -Esxi ‘Esxi048.domain.local’ -rootpw ‘password.123’ | ft *
BankLabel Manufacturer Description SizeGB MemoryType MemoryDef
——— ———— ———– —— ———- ———
P0_Node0_Channel0_Dimm0 Samsung P1-DIMMA1 16 24 DDR3
P0_Node0_Channel0_Dimm1 Samsung P1-DIMMA2 16 24 DDR3
P0_Node0_Channel1_Dimm0 Samsung P1-DIMMB1 16 24 DDR3
P0_Node0_Channel1_Dimm1 Samsung P1-DIMMB2 16 24 DDR3
P0_Node0_Channel2_Dimm0 Samsung P1-DIMMC1 16 24 DDR3
P1_Node1_Channel2_Dimm0 Samsung P2-DIMMG1 16 24 DDR3
P1_Node1_Channel2_Dimm1 Samsung P2-DIMMG2 16 24 DDR3
P1_Node1_Channel3_Dimm0 Samsung P2-DIMMH1 16 24 DDR3
P1_Node1_Channel3_Dimm1 Samsung P2-DIMMH2 16 24 DDR3
Winbond …625 11 Flash

.NOTES
NAME: Get-ESXiMemoryDimms

AUTHOR: Grzegorz Kulikowski

NOT WORKING ? #powercli @ irc.freenode.net

.LINK

http://psvmware.wordpress.com

#>
param([String]$Esxi,[string]$rootpw)

#MemoryTypes from: https://msdn.microsoft.com/en-us/library/aa394347(v=vs.85).aspx
$MemHash = @{
‘0’=’Unknown’;
‘1’=’Other’;
‘2’=’DRAM’;
‘3’=’Synchronous DRAM’;
‘4’=’Cache DRAM’;
‘5’=’EDO’;
‘6’=’EDRAM’;
‘7’=’VRAM’;
‘8’=’SRAM’;
‘9’=’RAM’;
’10’=’ROM’;
’11’=’Flash’;
’12’=’EEPROM’;
’13’=’FEPROM’;
’14’=’EPROM’;
’15’=’CDRAM’;
’16’=’3DRAM’;
’17’=’SDRAM’;
’18’=’SGRAM’;
’19’=’RDRAM’;
’20’=’DDR’;
’21’=’DDR2′;
’22’=’DDR2 FB-DIMM’;
’23’=’DDR2 FB-DIMM’;
’24’=’DDR3′;
’25’=’FBD2′
}
$pwd = ConvertTo-SecureString $rootpw -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential (“root”, $pwd)
$CIMOpt = New-CimSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -Encoding Utf8 –UseSsl
$Session = New-CimSession -Authentication Basic -Credential $cred -ComputerName $esxi -port 443 -SessionOption $CIMOpt
Get-CimInstance -CimSession $Session CIM_PhysicalMemory | select BankLabel, Manufacturer, Description , @{n=’SizeGB’;e={$_.Capacity/1GB}}, MemoryType, @{n=’MemoryDef’;e={$MemHash[$_.MemoryType]}}
}
[/sourcecode]

You may also like

Leave a Reply

Chinese (Simplified)EnglishFrenchGermanHindiPolishSpanish
Streaming live on Twitch right now.
CURRENTLY OFFLINE