CIM Session on DELL iDRac

Hi,

During my last techdays sessions about PowerShell remoting, i was speaking about CIM Sessions on third party vendors. Here is an example to gather CIM datas from an DELL iDRac.

Since the lastest versions of iDRac, WSMan & DMTF standards are included, so indeed we can play with PowerShell 3+ with it through CIM Sessions.

First of all, you’ll have to read peacefully the CIM library profile from DELL site here. Now, let’s PowerShellize it !

# Store iDRac credentials
$Credentials = Get-Credential

# iDRac Server HostName
$iDRacServer = "server_idrac"

Once thing here, is that i know my SSL Certificate is not signed and iDRac must receive UTF8 encoded chars. So we need to use New-CIMSessionOption to configure those bypasses/forces of parameters.

# Configure CIM Session Options
$CIMSessionOption = New-CimSessionOption -SkipCACheck -SkipCNCheck `
             -SkipRevocationCheck -Encoding Utf8 -UseSsl

And now, the creating of the session. Few tips about it, you must force Authentication to basic if you are in a domain, because by defualt Kerberos will be used. The port must be forced to 443 because … this is the listening iDRac port 🙂

# Connect to CIM Session
$CIMSession = New-CimSession -Authentication Basic `
           -Credential $Credentials -ComputerName iDRacServer -Port 443 -SessionOption $CIMSessionOption

Here is the result.. a old good CIM Session through WSMan 🙂

$CIMSession

Id           : 2
Name         : CimSession2
InstanceId   : 7e6a960d-0ad7-49ab-b7c0-f5295fe29d94
ComputerName : iDRacServer
Protocol     : WSMAN

Here, you’ll have to read the link previsouly given in the post, and you’ll can do something like that !

Get-CimInstance -CimSession $CIMSession `
      -ResourceUri "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/dcim/DCIM_SystemView"

 

AssetTag                   :
BIOSReleaseDate            : 08/29/2013
BIOSVersionString          : 2.0.19
BaseBoardChassisSlot       : NA
BatteryRollupStatus        : 1
BladeGeometry              : 4
BoardPartNumber            : #######
BoardSerialNumber          : ################
CMCIP                      :
CPLDVersion                : 1.0.3
CPURollupStatus            : 1
ChassisName                : Main System Chassis
ChassisServiceTag          : 59C65Z1
ChassisSystemHeight        : 1
ExpressServiceCode         : 11448550333
FQDD                       : System.Embedded.1
FanRollupStatus            : 1
HostName                   : iDRacServer
InstanceID                 : System.Embedded.1
LastSystemInventoryTime    : 20131230162013.000000+000
LastUpdateTime             : 20130927163159.000000+000
LicensingRollupStatus      : 1
LifecycleControllerVersion : 2.1.0
Manufacturer               : Dell Inc.
MaxCPUSockets              : 2
MaxDIMMSlots               : 24
MaxPCIeSlots               : 2
MemoryOperationMode        : OptimizerMode
Model                      : PowerEdge R620
PSRollupStatus             : 1
PlatformGUID               : 315a354f-c0b5-3680-4310-00394c4c4544
PopulatedCPUSockets        : 2
PopulatedDIMMSlots         : 4
PopulatedPCIeSlots         : 0
PowerCap                   : 465
PowerCapEnabledState       : 3
PowerState                 : 2
PrimaryStatus              : 1
RollupStatus               : 1
ServerAllocation           :
ServiceTag                 : #######
StorageRollupStatus        : 1
SysMemErrorMethodology     : 6
SysMemFailOverState        : NotInUse
SysMemLocation             : 3
SysMemMaxCapacitySize      : 1572864
SysMemPrimaryStatus        : 1
SysMemTotalSize            : 32768
SystemGeneration           : 12G Monolithic
SystemID                   : 1230
SystemRevision             : 0
TempRollupStatus           : 1
UUID                       : 4c4c4544-0039-4310-8036-b5c04f355a31
VoltRollupStatus           : 1
smbiosGUID                 : 44454c4c-3900-1043-8036-b5c04f355a31
PSComputerName             : iDRacServer

Cool isn’t it ?

Hope you’ll find an use for this !

 

NB: do not forget to close your CIM Session because if it’s gone on timeout, you won’t be able to kill your session until your restart physically your server. i Mean you have to unplug the CPU !

 

Regards,