iDRAC PS Library

The Dell iDRAC Powershell library follows in the footsteps of the iLO Powershell Library I wrote earlier this month. to use the code, all you need to do it put a .”\path\to\RACLibrary.ps1″ in the start of any scripts that you intend to use the functions in.

Download iDRAC Powershell Library

Please do not forget to set the $username and $pass in your scripts – these variables are used by the Library as the login username and password for the RAC Interfaces. I recommend that for security you set these variable by passing in as a command-line argument.

There are only few major functions in this library you need to be concerned with.

  • get-RACConfig
  • set-RACConfig
  • set-RACConfigFromFile

All other set- functions roll up a number of set-RACConfig commands into one function with a nice output. If I have not created a function here, it is probably because:

  • Too Many Input variables – too complex a function
  • Not enough configuration objects in group to warrant it’s own function
  • Some things really should be done RACConfigFromFile to ensure no typos (Directory configuration for example).
  • Some settings not commonly altered.

Please be aware that RACConfigFromFile is the fastest way to configure iDRACs but you Don’t get a lot of detail about application of Configuration. set-RACConfig will give you more granular details of configuration setting but is exponentially slower as it has to run the racadm.exe tool for each object being configured. This is the tradeoff
you need to consider for writing your scripts.


2012-01-23 1.0 Initial Release


get-RACConfig [string]$hostname, [string]$RACConfigGroup, [int]$RACIndex
Gets the DRAC Config from the specified RAC Configuration Group and returns as an Object If $RACIndex (optional) is specified, will return Configuration from Specific Config Index Number

set-RACConfigFromFile ([string]$hostname, [string]$RACConfigFile)
Sets the DRAC Configuration based on Configuration file $RACConfigFile Output of command returned as an Array of objects

set-RACConfig [string]$hostname, [string]$RACConfigGroup, [string]$RACConfigObject, [string]$RACConfigValue, [int]$RACIndex
Sets the DRAC Configuration Object based on Config Group, Object and Value supplied. If $RACIndex (Optional) is set, Configuration will be applied to the particular index number. This is the major function of the library, and many other functions rely on it.

set-RACNetworkIPv4 [string]$hostname,[string]$RACIP, [string]$RACNetmask,[string]$RACGateway
Configure basic IPv4 Settings for DRAC, including IP, Netmask and IP Gateway

set-RACNetworkDNS[string]$hostname,[string]$RACDNS1, [string]$RACDNS2,[string]$RACDNSName,[string]$RACDNSDomain
Configure DNS Settings for DRAC interface

set-RACNetworkVLAN [string]$hostname, [int]$RACVLANEnable, [int]$RACVLANID, [int]$RACVLANPri
Configure VLAN Settinsg for DRAC Interface

set-RACSyslog[string]$hostname,[int]$RACSysLogEnable, [string]$RACSyslogLServer1,[string]$RACSyslogLServer2,[string]$RACSyslogLServer3,[int]$RACSyslogPort
Configure Syslog Settings for DRAC Interface

set-RACTftp[string]$hostname,[int]$RACTftpEnable, [string]$RACTftpIP,[string]$RACTftpPath
Configure TFTP Settings for DRAC Interface

set-RACEmailAlert [string]$hostname,[int]$RACEmailIndex, [int]$RACEmailAlertEnabled,[string]$RACEmailAlertAddress,[string]$RACEMailAlertCustomMsg
Configure RAC Email Alert Settings. Index required

set-RACSNMP [string]$hostname,[int]$RACSNMPEnable, [string]$RACSNMPCommunity
Configure SNMP Settings for DRAC

set-RACSSLInfo [string]$hostname,[int]$RACSSLIndex,[int]$RACSSLKeySize, [string]$RACSSLCN,[string]$RACSSLOrgName,[string]$RACSSLOU,[string]$RACSSLLocality, [string]$RACSSLState, [string]$RACSSLCountry, [string]$RACSSLEmail
Configure the SSL Certificate information for DRAC Interface

Test-RACAlerts [string]$hostname, [int]$RACAlertIndex
Test the Email and SNMP Alert functionality of the DRAC and return results as an object


6 thoughts on “iDRAC PS Library

  1. d_

    Nice work. one error:

    Line 203 – $result2 = set-RACConfig $hostname “cfgEmailAlert” “cfgEmailAlertAddress” $RACEmailAlertAddress-RACIndex $RACEmailIndex
    need a space before -RACIndex

    The other problem i had, i was putting commas between values when calling functions, ie: get-RACConfig $hostname, $RACConfigGroup etc..

    Lack of powershell experience on my part.

    But great overall. I’ve used it to audit some of our servers. Looking forward to using against our 100+ servers.

    1. Ben Post author

      Hi d_
      Thanks for this. I will do the bug fix when I get home tomorrow. Currently in Sydney with Dell 🙂

  2. Khang

    Hi Ben,

    I’m looking for a way to obtain the parent enclosure info for a blade (without logging into the web CONSOLE).

    Do you have any suggestions?

    1. Ben Post author

      Hi Khang,
      I can’t actually do any testing, as I do not have any Dell Blade infrastructure in my environment, but perhaps the racadm tool will work using getconfig?

      racadm -r server – u user -p password getconfig -f filename.txt

    1. Ben Post author

      Hi Cory,
      Ideally it should be before any functional code is written e.g. before or immediately after variable initialisation.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s