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

Tuesday, December 12, 2017

updating domain name on Dell iDRACs of VxRack

this is just another continuation post for idRAC automation examples. This will help you update domain name on multiple iDRACs.


 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
28
29
30
31
32
33
34
35
36
37
38
<#
.SYNOPSIS
    set the hostname for dell iDRAC servers
.DESCRIPTION
    opens up a csv file. put the ip addresses of idrac, root password and the domain name to be set
.NOTES
    File Name      : idracSetDomain.ps1
    Author         : gajendra d ambi
    Date           : Dec 2017
    Prerequisite   : PowerShell v4+, Dell OpenManage DRAC Tools, includes Racadm (64bit) v8.1 or higher
    Copyright      - None
.LINK
    Script posted over: github.com/MrAmbiG/
#>
#Start of Script

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/idracSetDomain.csv"
get-process | Select-Object idrac_ip_address, root_password, DomainName | 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) 
 {
    $idrac_ip_address = $($line.idrac_ip_address)
    $root_password = $($line.root_password)
    $DomainName = $($line.DomainName)
    Write-Host "setting $DomainName as DomainName on $idrac_ip_address"
    racadm -r $idrac_ip_address -u "root" -p $root_password --nocertwarn set iDRAC.NIC.DNSDomainName $DomainName
 }