Reply to Message

Reply to Message

View discussion in a popup

Replying to:
UBruns
1 Nickel

RE: Calling "ImportSSLCertificate" over CimSession

Solved for me!

Ok.. seems that there are some function and documentation errors/issues

First - what I am calling using PowerShell - where

$session is an established CIM-Session to the iDRAC
$certfile is the full path to the certificate file

$certdata = get-content $certfile -raw
$iCardService = Get-CimInstance -CimSession $session -ResourceUri "schemas.dell.com/.../DCIM_iDRACCardService" -Namespace "root/dcim"
$result = Invoke-CimMethod -CimSession $session -InputObject $iCardService -MethodName 'ImportSSLCertificate' -Arguments @{SSLCertificateFile=$certdata;CertificateType=1}

In the documentation (*1) are the following ReturnValues stated:

0 = Completed with no error
2 = Failed

and as returned Message ID:

LC077 = Certificate imported successfully.iDRAC will now restart and be unavailable during restart.
LC011 = Certificate import operation failed.

And here is my "$result | fl" :

Message: Reset iDRAC to apply new certificate. Until iDRAC is reset, the old certificate will be active.
MessageID: DH010
ReturnValue: 2

So what ??? Message sounds good, but this is in an unexpected MessageID and also the ReturnValue says 'Failed'
I expected the documented Message IDs and ReturnValues as documented in my scripts... so every time I stopped the script with an error.

But.. I will give it a try... lets reset the iDRAC (=> reboot the iDRAC)

$result2 = Invoke-CimMethod -CimSession $session -InputObject $iCardService -MethodName 'iDRACReset' -Arguments @{Force=0}

Let us look at this result '$result2 | fl'

Message: iDRAC was successfully reset.
MessageID: RAC064
ReturnValue: 2

Oh... the word 'successfully'.. sounds good... but why is the ReturnValue = 2 (Failed) ???

I don't know. What I know is, the iDRAC was rebooting...

After resetting the iDRAC I connected again to the WebGui and all was fine! The certificate was installed and the browser warnings where gone...

So... I think.. check all function results by yourself... and test it.

UBruns

Documentation Links:

*1 = DCIM iDRAC Card Profile 1.5.4
http://en.community.dell.com/techcenter/extras/m/white_papers/20442351

Tags (1)