iDRAC Powershell Setup and Basic Audit

With the introduction of the Dell Hardware into the VxRack SDDC and Flex1000 ecosystems, I figured I better spend some time figuring out the iDRAC PowerShell cmdlets.

Prerequisites: Powershell v3 minimum Installed

iDRAC Module Locations: http://en.community.dell.com/techcenter/systems-management/w/wiki/7727.powershell-cmdlets-for-poweredge-servers

Check where your current modules are installed by running this command

Get-Module –ListAvailable

Your Module Location will be listed as below.

show-module

Unzip the iDRAC module into this location and relaunch your PowerShell application. Your new module should be listed.

dell-module

Connect to iDRAC node

$myhost0 = New-PEDRACSession -IPAddress 192.168.0.50

createsession

Use the $myhost0 variable with Get-PESystemInformation cmdlet to gather further information on your system.

Get-PESystemInformation -iDRACSession $myhost0

get-info

Better still save that command as a variable and you can pick and choose what details you want to parse from the host.

$myhost0details = Get-PESystemInformation -iDRACSession $myhost0
$myhost0details.BIOSVersionString

firmware.png

Now we want to select multiple values and pass them out to a new CSV file called idrac.csv

$myhost0details | select BIOSVersionString, UUID | Export-Csv c:\idrac.csv

Here are the results.

csv

So now I wanted to increase the data I  collected and run it on all my iDRAC server.

# set login for all sessions
$DRACCredential = Get-Credential
#Set number of host
Write-host "Please enter number of host" 
$numberofhost = Read-Host
#Set First host Ip address - im assuming that iDrac address are in sequence
Write-host "Please enter first ipadress" 
$ipofhost = Read-Host
#spliting the ip address so i can them later and converting to a integer 
$idrac_ip_start_int = $ipofhost.split(".")
$idrac_ip_start_int=[int]$idrac_ip_start_int[3]

#quick for looop
for ($i=0; $i -le $numberofhost; $i++)
{

$idracplitip = $ipofhost.split('.')
#setting the ip adddress of the idrac
$idrachostip = $idracplitip[0] + '.' + $idracplitip[1] + '.' + $idracplitip[2] + '.' + $idrac_ip_start_int
Write-host Collecting Data from $idrachostip
#logging in
$myhost0 = New-PEDRACSession -IPAddress $idrachostip -Credential $DRACCredential
#getting all the system info
$null = Get-PESystemInformation -iDRACSession $myhost0
#saving that info as a variable
$myhost0details = Get-PESystemInformation -iDRACSession $myhost0
#pulling the details i want adn exporting to a csv file
$myhost0details | select Hostname, LifecycleControllerVersion, BIOSVersionString, UUID | Export-Csv -append c:\idrac.csv
#imcremtnating the last value in the ip address by 1 so i can use it for the next host
$idrac_ip_start_int = $idrac_ip_start_int +1
}

And the result

idracps1.PNG

result

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s