Recently I had an opportunity to work with several new Dell PowerEdge R810 physical servers. I needed to remotely connect to the console of these servers and found out they were equipped with Integrated Dell Remote Access Controller 6 – Enterprise (iDRAC) cards. Since I had several of these to configure — and as a scripter am fundamentally opposed to doing things manually — I started researching how to script this.
After a bit of Googling, I found out that Dell has a RACADM command that can be used to configure the iDRAC. You can get the Dell RAC configuration utility from Dell. After installing the utility, I opened a command prompt and retreived the configuration from an existing R810 using the following syntax:
racadm -r 192.168.252.108 -u root -p calvin getconfig -f C:\252-108_config.cfg
Looking through the exported configuration, I found several groups and objects that I wanted to specify in my scripted configuration. Command line switches exist so that you can import an entire configuration file, but I wanted to prompt for certain values and only update the items I wanted to specifically change. Not wanting to dwell on the script for too long, I put something together rather quick using a simple batch file. Here is that code…please feel free to offer suggestions or better solutions in the comments!
[cc lang=”dos” width=”520″]
@echo off
set /P dracIP=”Please enter the IP address of the DRAC: ”
set /P dracName=”Please enter the name of the server to configure: ”
set /P dracDomain=”Please enter the DNS domain name to use: ”
echo These commands need issued individually as the pass arguments from the environment to the server
racadm -r %dracIP% -u root -p calvin config -g cfgLanNetworking -o cfgDNSRacName %dracName%rac
racadm -r %dracIP% -u root -p calvin config -g cfgLanNetworking -o cfgDNSDomainName %dracDomain%
racadm -r %dracIP% -u root -p calvin config -g cfgLanNetworking -o cfgDNSRegisterRac 1
racadm -r %dracIP% -u root -p calvin config -g cfgLanNetworking -o cfgDNSServer1 192.168.8.8
racadm -r %dracIP% -u root -p calvin config -g cfgLanNetworking -o cfgDNSServer2 10.168.8.4
REM pause
echo These commands are going to enable Active Directory Standard Schema configs
racadm -r %dracIP% -u root -p calvin config -g cfgActiveDirectory -o cfgADEnable 1
racadm -r %dracIP% -u root -p calvin config -g cfgActiveDirectory -o cfgADType 2
racadm -r %dracIP% -u root -p calvin config -g cfgActiveDirectory -o cfgADCertValidationEnable 0
racadm -r %dracIP% -u root -p calvin config -g cfgActiveDirectory -o cfgADDcSRVLookupEnable 1
racadm -r %dracIP% -u root -p calvin config -g cfgActiveDirectory -o cfgADDcSRVLookupbyUserdomain 1
racadm -r %dracIP% -u root -p calvin config -g cfgActiveDirectory -o cfgADGcSRVLookupEnable 1
racadm -r %dracIP% -u root -p calvin config -g cfgActiveDirectory -o cfgADGcRootDomain test.local
REM echo Configure domains to login with
racadm -r %dracIP% -u root -p calvin config -g cfgUserDomain -i 1 -o cfgUserDomainName test.local
racadm -r %dracIP% -u root -p calvin config -g cfgUserDomain -i 2 -o cfgUserDomainName admin.test.local
echo Make the DRACAdmin an Administrator
racadm -r %dracIP% -u root -p calvin config -g cfgStandardSchema -i 1 -o cfgSSADRoleGroupName DRACAdmin
racadm -r %dracIP% -u root -p calvin config -g cfgStandardSchema -i 1 -o cfgSSADRoleGroupDomain admin.test.local
racadm -r %dracIP% -u root -p calvin config -g cfgStandardSchema -i 1 -o cfgSSADRoleGroupPrivilege 0x000001ff
echo Make the DRACUser an Operator
racadm -r %dracIP% -u root -p calvin config -g cfgStandardSchema -i 2 -o cfgSSADRoleGroupName DRACUser
racadm -r %dracIP% -u root -p calvin config -g cfgStandardSchema -i 2 -o cfgSSADRoleGroupDomain admin.test.local
racadm -r %dracIP% -u root -p calvin config -g cfgStandardSchema -i 2 -o cfgSSADRoleGroupPrivilege 0x000001f3
REM pause
echo Make/update the local account
racadm -r %dracIP% -u root -p calvin config -g cfgUserAdmin -i 3 -o cfgUserAdminUserName MyAdminUser
racadm -r %dracIP% -u root -p calvin config -g cfgUserAdmin -i 3 -o cfgUserAdminPassword MyAdminP@ss
racadm -r %dracIP% -u root -p calvin config -g cfgUserAdmin -i 3 -o cfgUserAdminEnable 1
racadm -r %dracIP% -u root -p calvin config -g cfgUserAdmin -i 3 -o cfgUserAdminPrivilege 0x000001ff
racadm -r %dracIP% -u root -p calvin config -g cfgUserAdmin -i 3 -o cfgUserAdminIpmiLanPrivilege 4
racadm -r %dracIP% -u root -p calvin config -g cfgUserAdmin -i 3 -o cfgUserAdminIpmiSerialPrivilege 4
racadm -r %dracIP% -u root -p calvin config -g cfgUserAdmin -i 3 -o cfgUserAdminSolEnable 0
Echo Please verify settings and disable/change password on root if everything is in order
Echo Thanks!
pause
[/cc]
Is there away of getting a DRAC’s current configuration using powershell? I’m trying to find a way to get current drac config’s from servers using powershell. If anyone knows could you please post – Thanks
I wasn’t able to find a set of PowerShell cmdlets to manage the DRAC. The best I could think of would be to use powershell to execute the racadm command, export the configuration to a file and then use Get-Content to read through each line and look at the config. Not ideal, but its the only solution I can think of…unless someone can find Dell PS cmdlets — if so please let me know too!
Hi Brain, yes that is what i eneded up doing but a bit of a long way round. If posted this Q to Dell to see if they can develope a cmdlet of wmi for the future….so here’s hoping
Hello, Hector was hoping but I hope it is not too late for my reply to be useful. R810 is the 11th generation of PowerEdge servers and it came with a Web Service interface (WSMAN) that you can use to manage the server remotely, securely and standards-based. If you’ve used winrm then this is familiar to you. Consequently, PowerShell has native support for WSMAN. To poke your interest, you can check out psDcim which gives you an example on how to get system model. Here’s the link: http://en.community.dell.com/techcenter/extras/m/white_papers/20105345.aspx – Have fun!