dell / iDRAC-Redfish-Scripting

Python and PowerShell scripting for Dell EMC PowerEdge iDRAC REST API with DMTF Redfish
GNU General Public License v2.0
598 stars 276 forks source link

python scipt with AD account #212

Closed MarcPro92 closed 2 years ago

MarcPro92 commented 2 years ago

Hello,

I try to use python script : InstallFromRepositoryREDFISH.py with an active directory account but without sucess.

i try the following syntax : python InstallFromRepositoryREDFISH.py -ip xx.xx.xx.xx -u user@domain -p password ...

python InstallFromRepositoryREDFISH.py -ip xx.xx.xx.xx -u domain/user -p password ...

python InstallFromRepositoryREDFISH.py -ip xx.xx.xx.xx -u domain\user -p password ...

answer : - WARNING, unable to access iDRAC, check to make sure you are passing in valid iDRAC credentials

user and password works fine on the iDRAC GUI

Is it possible to use an AD domain account or just an local account ?

texroemer commented 2 years ago

Hi @MarcPro92

Yes AD accounts are supported but you need to surround username with double quotes so Python can process it correctly.

Examples:

root@localhost opt]# python3 InstallFromRepositoryREDFISH.py -ip 192.168.0.120 -u "example.i\aduser" -p calvin1234 -g y

- INFO, current devices detected with firmware version and updateable status -

Device Name: PERC H730P Mini, Firmware Version: 25.5.6.0009, Updatable: True
Device Name: OS COLLECTOR, 3.0, A00, Firmware Version: 3.0, Updatable: True
Device Name: Intel(R) Ethernet Converged Network Adapter X710 - 3C:FD:FE:4F:12:A2, Firmware Version: 18.5.17, Updatable: True
Device Name: Backplane 1, Firmware Version: 2.25, Updatable: True
Device Name: iDRAC Service Module Installer, 3.0.1, A00, Firmware Version: 3.0.1, Updatable: True
Device Name: Intel(R) Ethernet Server Adapter X710-DA2 for OCP - 3C:FD:FE:4F:12:A0, Firmware Version: 18.5.17, Updatable: True
Device Name: Intel(R) Gigabit I350-t LOM - 80:18:44:7A:15:29, Firmware Version: 18.0.16, Updatable: True
Device Name: Chassis CM Embedded, Firmware Version: 1.45, Updatable: True
Device Name: BIOS, Firmware Version: 2.12.2, Updatable: True
Device Name: Dell OS Driver Pack, 21.07.06, A00, Firmware Version: 21.07.06, Updatable: True
Device Name: Integrated Dell Remote Access Controller, Firmware Version: 5.00.10.20, Updatable: True
Device Name: Dell 64 Bit uEFI Diagnostics, version 4301, 4301A56, 4301.57, Firmware Version: 4301A56, Updatable: True
Device Name: System CPLD, Firmware Version: 1.0.7, Updatable: True
Device Name: Lifecycle Controller, Firmware Version: 5.00.10.20, Updatable: True

[root@localhost opt]# python3 InstallFromRepositoryREDFISH.py -ip 192.168.0.120 -u "example.i/aduser" -p calvin1234 -g y

- INFO, current devices detected with firmware version and updateable status -

Device Name: PERC H730P Mini, Firmware Version: 25.5.6.0009, Updatable: True
Device Name: OS COLLECTOR, 3.0, A00, Firmware Version: 3.0, Updatable: True
Device Name: Intel(R) Ethernet Converged Network Adapter X710 - 3C:FD:FE:4F:12:A2, Firmware Version: 18.5.17, Updatable: True
Device Name: Backplane 1, Firmware Version: 2.25, Updatable: True
Device Name: iDRAC Service Module Installer, 3.0.1, A00, Firmware Version: 3.0.1, Updatable: True
Device Name: Intel(R) Ethernet Server Adapter X710-DA2 for OCP - 3C:FD:FE:4F:12:A0, Firmware Version: 18.5.17, Updatable: True
Device Name: Intel(R) Gigabit I350-t LOM - 80:18:44:7A:15:29, Firmware Version: 18.0.16, Updatable: True
Device Name: Chassis CM Embedded, Firmware Version: 1.45, Updatable: True
Device Name: BIOS, Firmware Version: 2.12.2, Updatable: True
Device Name: Dell OS Driver Pack, 21.07.06, A00, Firmware Version: 21.07.06, Updatable: True
Device Name: Integrated Dell Remote Access Controller, Firmware Version: 5.00.10.20, Updatable: True
Device Name: Dell 64 Bit uEFI Diagnostics, version 4301, 4301A56, 4301.57, Firmware Version: 4301A56, Updatable: True
Device Name: System CPLD, Firmware Version: 1.0.7, Updatable: True
Device Name: Lifecycle Controller, Firmware Version: 5.00.10.20, Updatable: True

[root@localhost opt]# python3 InstallFromRepositoryREDFISH.py -ip 192.168.0.120 -u "aduser@example.i" -p calvin1234 -g y

- INFO, current devices detected with firmware version and updateable status -

Device Name: PERC H730P Mini, Firmware Version: 25.5.6.0009, Updatable: True
Device Name: OS COLLECTOR, 3.0, A00, Firmware Version: 3.0, Updatable: True
Device Name: Intel(R) Ethernet Converged Network Adapter X710 - 3C:FD:FE:4F:12:A2, Firmware Version: 18.5.17, Updatable: True
Device Name: Backplane 1, Firmware Version: 2.25, Updatable: True
Device Name: iDRAC Service Module Installer, 3.0.1, A00, Firmware Version: 3.0.1, Updatable: True
Device Name: Intel(R) Ethernet Server Adapter X710-DA2 for OCP - 3C:FD:FE:4F:12:A0, Firmware Version: 18.5.17, Updatable: True
Device Name: Intel(R) Gigabit I350-t LOM - 80:18:44:7A:15:29, Firmware Version: 18.0.16, Updatable: True
Device Name: Chassis CM Embedded, Firmware Version: 1.45, Updatable: True
Device Name: BIOS, Firmware Version: 2.12.2, Updatable: True
Device Name: Dell OS Driver Pack, 21.07.06, A00, Firmware Version: 21.07.06, Updatable: True
Device Name: Integrated Dell Remote Access Controller, Firmware Version: 5.00.10.20, Updatable: True
Device Name: Dell 64 Bit uEFI Diagnostics, version 4301, 4301A56, 4301.57, Firmware Version: 4301A56, Updatable: True
Device Name: System CPLD, Firmware Version: 1.0.7, Updatable: True
Device Name: Lifecycle Controller, Firmware Version: 5.00.10.20, Updatable: True
MarcPro92 commented 2 years ago

Hi @texroemer

Thanks. That works better with double quotes, i also needed to add double quotes on password (may be due to special character in it)

rgds,