So here’s the situation. We have a bunch of HP rack enclosures. Some blade servers were moved from one rack to another but the person doing the move forgot to note down the new location. I knew the iLO IP address but didn’t know which enclosure it was in. Rather than login to each enclosure OA, expand the device bays and iLO info and find the blade I was interested in, I wrote this batch file that makes use of SSH/ PLINK to quickly find the enclosure the blade was in.
1 2 3 4 5 |
@echo off FOR %%I IN (R1E1-OA1,R1E2-OA1,R2E1-OA1,R2E2-OA1) DO ( echo Checking %%I echo y | PLINK.EXE admin@%%I -pw <password> "show ebipa" | findstr "<iLO-Address>" ) |
Put this in a batch file in the same folder as PLINK and run it.
Note that this does depend on SSH access being allowed to your enclosures.
Update: An alternative way if you want to use PowerShell for the looping –
1 2 3 4 5 |
"R1E1-OA1","R1E2-OA1","R2E1-OA1","R2E2-OA1"| %{ $EncName = $_; Write-Host -ForegroundColor Yellow "Checking $EncName"; .\PLINK.EXE -ssh $EncName -l admin -pw <passwd> "show ebipa" | ?{ $_ -match "<iLO Address>" } } |