ProLiant Servers (ML,DL,SL)
1826909 Members
3000 Online
109705 Solutions
New Discussion

Change ILO password on many ilo

 
SOLVED
Go to solution
cth1
Advisor

Change ILO password on many ilo

Hi

I have a lot of DL servers gen 8,9 and 10 that I need to change ILO password on.

I'm looking for at way to do it easy change password on all servers at one time....

At least the one in same network (most of them)..

At the moment they all have the same user and password.

In future user should be the same but password should be individual.

 

I have tried with a powershell script and ilorest and a csv file with alle ilo ip and username and passwords.

 

But I did not have luck enough to get it working.

 

What is the best way to do it?

6 REPLIES 6
shiva_jr
HPE Pro

Re: Change ILO password on many ilo

Hi @cth1 ,

    This post may help you in iLO rest commands for iLO Password reset.
    This site will help you in understanding the commands.
Regards,
Shiva_jr



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
cth1
Advisor

Re: Change ILO password on many ilo

@shiva_jr 

Thanks

 

I actually did see that link when I was googling

But I not sure I understood it complete.

But maybe I can try again

 

But hpconcfg is that the same as ilo rest?

 

Maybe I'm to newbie for this... and faster to do it manually

 

 

 

 

cth1
Advisor

Re: Change ILO password on many ilo

Hi

 

I tried the linked solution but did not work for me....

I have found solution with ilorest, but also this seems to be difficult to get working

 

cth1
Advisor
Solution

Re: Change ILO password on many ilo

I have created my own solution. it works fine. Sorry it's in danish some places.

From a server that can ping ILO ip's

1. Create ilo_list.txt file with ILO ip's that need passsword change.

2. Install HPEiLOCmdlets for powershell 

3. Use this script and change user,pasword and new password:

 

# Ignorer SSL-certifikatfejl
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }

# Importer nødvendige moduler
Import-Module HPEiLOCmdlets -ErrorAction Stop

# Parametre
$inputFile = "ilo_list.txt" # Fil med iLO IP-adresser
$currentUsername = "user1" # Aktuelt brugernavn
$currentPassword = "pass6666" # Aktuelt password
$newPassword = "pass7777" # Nyt password

# Timeout for forbindelsen
$timeout = 60

# Tjek om inputfilen eksisterer
if (-Not (Test-Path $inputFile)) {
Write-Host "Inputfil '$inputFile' blev ikke fundet. Afslutter." -ForegroundColor Red
exit
}

# Læs IP-adresser fra filen
$iloIPs = Get-Content $inputFile

# Skift password på hver iLO
foreach ($ip in $iloIPs) {
Write-Host "Forbinder til iLO på IP-adresse: $ip" -ForegroundColor Yellow
try {
# Opret forbindelse til iLO
$connection = Connect-HPEiLO -Address $ip -Username $currentUsername -Password $currentPassword -DisableCertificateAuthentication -Timeout $timeout -Verbose

if ($connection -ne $null) {
Write-Host "Forbindelsen til iLO på IP: $ip er oprettet." -ForegroundColor Green

# Skift adgangskoden
Set-HPEiLOUser -Connection $connection -LoginName $currentUsername -NewPassword $newPassword -Verbose
Write-Host "Adgangskode opdateret for iLO på IP: $ip" -ForegroundColor Green

# Afbryd forbindelsen
Disconnect-HPEiLO -Connection $connection
} else {
Write-Host "Kunne ikke oprette forbindelse til iLO på IP: $ip" -ForegroundColor Red
}
} catch {
Write-Host "Fejl ved forbindelse til iLO på IP: $ip - $_" -ForegroundColor Red
}
}

Write-Host "Færdig med at opdatere adgangskoder." -ForegroundColor Cyan

 

 

Sunitha_Mod
Honored Contributor

Re: Change ILO password on many ilo

Hello @cth1,

That's Awesome! 

We are delighted to hear your were able to find the solution and we appreciate you for keeping us updated. 

cth1
Advisor

Re: Change ILO password on many ilo

Sorry... my solution works on ILO 4 but not ILO 5 with TPM

Is there a powershell command that overrides TPM so that I can change the password?

 

I get this error and password is not changed.

I think it's a TPM issue

ERROR HPE.Framework.Core.StatusInfo