profile for Gajendra D Ambi on Stack Exchange, a network of free, community-driven Q&A sites

Tuesday, December 12, 2017

Cloning the Dell iDRAC configuration to others

Hopefully this is the last among-st my series of iDRAC configuration automation. This takes one source machine as reference, takes the xml and pushes it to all the others. Whatever changes that you want to edit or omit, you can when the script is paused for you to update the csv files.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$source = '10.1.211.222'
$user = 'root'
$pass = 'P@ssword'
$filename = "$source.xml"
$sourceXml = "$psscriptroot"+"$filename"
if (!$sourceXml) {
racadm -r $server -u $user -p $pass get -t xml -f $sourceXml
} else { Read-Host "There is an existing $sourceXml sourcefile configuration, Hit enter/return to use the same" }

Write-Host "
A CSV file will be opened (open in excel/spreadsheet)
populate the values,
save & close the file,
Hit Enter to proceed
" -ForegroundColor Blue -BackgroundColor White

$csv = "$PSScriptRoot/nameCompare.csv"
get-process | Select-Object idrac_ip_address| Export-Csv -Path $csv -Encoding ASCII -NoTypeInformation
Start-Process $csv
Read-Host "Hit Enter/Return to proceed"
Write-Host "processing your entries from the csv file...."
$csv = Import-Csv $csv
 foreach ($line in $csv) 
 {
    $server = $($line.server)
    racadm -r $server -u $user -p $pass set -t xml -f $sourceXml
 }