Closed Rouzax closed 4 years ago
Hi @Rouzax
Typo in print statement when i made the update from Python 2 to Python 3. Script has been corrected and uploaded to GitHub. I also updated the script to use argparse, be consistent with other Python scripts. I also added support to get iDRAC user account information.
Example of executing new script:
C:\Python38-32>python3 ChangeIdracUserPasswordREDFISH.py -h usage: ChangeIdracUserPasswordREDFISH.py [-h] -ip IP -u U -p P [-g G] [-id ID] [-np NP]
Python script using Redfish API with OEM extension to change iDRAC username password. Once the password is changed, the script will also execute a GET command to verify the password change was successful.
positional arguments: script_examples ChangeIdracUserPasswordREDFISH.py -ip 192.168.0.120 -u root -p calvin -g y, this example will get user account information for all iDRAC users. ChangeIdracUserPasswordREDFISH.py -ip 192.168.0.120 -u user -p calvin -id 3 -np pAssw0rd, this example shows changing iDRAC user ID 3 password.
optional arguments: -h, --help show this help message and exit -ip IP iDRAC IP address -u U iDRAC username -p P iDRAC password -g G Get iDRAC user account information, pass in "y". This will return detailed information for each iDRAC user account. -id ID Pass in the iDRAC user account ID you want to change the password for. If needed, use argument -g to get the iDRAC user account ID. -np NP Pass in the new password you want to set for the iDRAC user ID.
C:\Python38-32>python3 ChangeIdracUserPasswordREDFISH.py -ip 192.168.0.120 -u user3 -p calvin -id 3 -np p@ssw0rd
PASS, status code 200 returned for PATCH command to change iDRAC user password
WARNING, executing GET request using new password for validating successful change
PASS, status code 200 returned for GET command, iDRAC user password change success
Running https://github.com/dell/iDRAC-Redfish-Scripting/blob/master/Redfish%20Python/ChangeIdracUserPasswordREDFISH.py will give
Running Python 3.8.2 Server in question is R930 with iDRAC 2.70.70.70