Last active
August 9, 2022 13:51
-
-
Save ksingh7/3f1158493ca8bfafc705 to your computer and use it in GitHub Desktop.
HP ILO user create from CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script to create admin and administrator user | |
#!/bin/bash | |
IPs=`echo 86.50.1.{150..168}` | |
for ip in $IPs | |
do | |
echo Starting $ip | |
sshpass -p 'ROOTPWD' ssh -o StrictHostKeyChecking=no -l root $ip "create /map1/accounts1 username=Administrator password=ADMINISTRATORPWD name=Administrator group=admin,config,oemhp_rc,oemhp_power,oemhp_vm" | |
sshpass -p 'ROOTPWD' ssh -o StrictHostKeyChecking=no -l root $ip "create /map1/accounts1 username=admin password=ADMINPASSWORD name=admin group=admin,config,oemhp_rc,oemhp_power,oemhp_vm" | |
done | |
# script to reset password | |
#!/bin/bash | |
IPs=`echo 86.50.1.{150..167}` | |
for ip in $IPs | |
do | |
echo Starting $ip | |
sshpass -p 'ROOTPWD' ssh -o StrictHostKeyChecking=no -l root $ip "set /map1/accounts1/Administrator password=NEWADMINISTRATORPWD" | |
sshpass -p 'ROOTPWD' ssh -o StrictHostKeyChecking=no -l root $ip "set /map1/accounts1/admin password=NEWADMINPASSWORD" | |
sshpass -p 'ROOTPWD' ssh -o StrictHostKeyChecking=no -l root $ip "set /map1/accounts1/root password=NEWROOTPASSWORD" | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Was looking for the ilo commands, came across your git
Here's what I ended up putting together with it
#Usage
addilouser US-SERVER{01..25}-ilo