I want to deploy a script from a Linux machine.<\/p>\n
This is the script I want to run on servers using racadm but I am getting errors in that code.<\/p>\n
#!/bin/bashIDRAC_IP_LIST=\"idrac_ips.txt\"USERNAME=\"root\"# Securely read passwords from hidden filesLOCAL_IDRAC_PASSWORD=$(< /root/.idrac_local_pass)LDAP_BIND_PASSWORD=$(< /root/.idrac_ldap_pass)# Trim whitespace (especially newlines)LOCAL_IDRAC_PASSWORD=$(echo -n \"$LOCAL_IDRAC_PASSWORD\")LDAP_BIND_PASSWORD=$(echo -n \"$LDAP_BIND_PASSWORD\")echo \"Starting LDAP configuration rollout to iDRACs...\"while IFS= read -r IP || [[ -n \"$IP\" ]]; doecho \"----------------------------------------\"echo \"Configuring iDRAC at $IP ...\"OUTPUT=$(racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.Enable 1 &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.ServerAddress ldap2.myuni.ac.uk &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.ServerPort 636 &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.UseSSL 1 &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.BindDN \"cn=ldapusername,ou=auth-users,ou=LDAP,ou=UNI,o=MYUNI\" &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.BindPass \"$LDAP_BIND_PASSWORD\" &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.BaseDN \"ou=ITADMINS,ou=ORGADMINS,o=MYUNI\" &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.UserAttribute cn &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.GroupAttribute member &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.SearchFilter \"(&(objectClass=inetOrgPerson)(member=cn=%USERNAME%,ou=ITROLES,ou=ORGADMINS,o=MYUNI))\" &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.GroupDN \"cn=role-it-csi-team,ou=ITROLES,ou=ORGADMINS,o=MYUNI\" &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.UserAuthorizationEnable 1 &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$IDRAC_PASSWORD\" set iDRAC.LDAP.CertValidation 0) 2>&1if [[ $? -eq 0 ]]; thenecho \"Success: LDAP settings updated on $IP\"elseecho \"ERROR on $IP:\"echo \"$OUTPUT\"fidone < \"$IDRAC_IP_LIST\"echo \"----------------------------------------\"echo \"All done.\"But this is the error that is displayed:root@fred-linux:~# ./idrac_ldap_config.shStarting LDAP configuration rollout to iDRACs...----------------------------------------Configuring iDRAC at 10.5.0.9 ...ERROR on 10.5.0.9:Security Alert: Certificate is invalid - self-signed certificateContinuing execution. Use -S option for racadm to stop execution on certificate-related errors.[Key=iDRAC.Embedded.1#LDAP.1]Object value modified successfullySecurity Alert: Certificate is invalid - self-signed certificateContinuing execution. Use -S option for racadm to stop execution on certificate-related errors.ERROR: Invalid object specified.----------------------------------------Configuring iDRAC at 10.5.0.11 ...ERROR on 10.5.0.11:Security Alert: Certificate is invalid - self-signed certificateContinuing execution. Use -S option for racadm to stop execution on certificate-related errors.[Key=iDRAC.Embedded.1#LDAP.1]Object value modified successfullySecurity Alert: Certificate is invalid - self-signed certificateContinuing execution. Use -S option for racadm to stop execution on certificate-related errors.ERROR: Invalid object specified.----------------------------------------All done.\n<\/code><\/pre>\n
Advertisement
Can you let me know what is wrong with this script or whether there should be some amendments?<\/p>","upvoteCount":2,"answerCount":4,"datePublished":"2025-06-19T10:41:08.048Z","author":{"@type":"Person","name":"spiceuser-7bks","url":"https://community.spiceworks.com/u/spiceuser-7bks"},"suggestedAnswer":[{"@type":"Answer","text":"
I want to deploy a script from a Linux machine.<\/p>\n
This is the script I want to run on servers using racadm but I am getting errors in that code.<\/p>\n
#!/bin/bashIDRAC_IP_LIST=\"idrac_ips.txt\"USERNAME=\"root\"# Securely read passwords from hidden filesLOCAL_IDRAC_PASSWORD=$(< /root/.idrac_local_pass)LDAP_BIND_PASSWORD=$(< /root/.idrac_ldap_pass)# Trim whitespace (especially newlines)LOCAL_IDRAC_PASSWORD=$(echo -n \"$LOCAL_IDRAC_PASSWORD\")LDAP_BIND_PASSWORD=$(echo -n \"$LDAP_BIND_PASSWORD\")echo \"Starting LDAP configuration rollout to iDRACs...\"while IFS= read -r IP || [[ -n \"$IP\" ]]; doecho \"----------------------------------------\"echo \"Configuring iDRAC at $IP ...\"OUTPUT=$(racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.Enable 1 &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.ServerAddress ldap2.myuni.ac.uk &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.ServerPort 636 &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.UseSSL 1 &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.BindDN \"cn=ldapusername,ou=auth-users,ou=LDAP,ou=UNI,o=MYUNI\" &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.BindPass \"$LDAP_BIND_PASSWORD\" &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.BaseDN \"ou=ITADMINS,ou=ORGADMINS,o=MYUNI\" &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.UserAttribute cn &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.GroupAttribute member &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.SearchFilter \"(&(objectClass=inetOrgPerson)(member=cn=%USERNAME%,ou=ITROLES,ou=ORGADMINS,o=MYUNI))\" &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.GroupDN \"cn=role-it-csi-team,ou=ITROLES,ou=ORGADMINS,o=MYUNI\" &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$LOCAL_IDRAC_PASSWORD\" set iDRAC.LDAP.UserAuthorizationEnable 1 &&racadm -r \"$IP\" -u \"$USERNAME\" -p \"$IDRAC_PASSWORD\" set iDRAC.LDAP.CertValidation 0) 2>&1if [[ $? -eq 0 ]]; thenecho \"Success: LDAP settings updated on $IP\"elseecho \"ERROR on $IP:\"echo \"$OUTPUT\"fidone < \"$IDRAC_IP_LIST\"echo \"----------------------------------------\"echo \"All done.\"But this is the error that is displayed:root@fred-linux:~# ./idrac_ldap_config.shStarting LDAP configuration rollout to iDRACs...----------------------------------------Configuring iDRAC at 10.5.0.9 ...ERROR on 10.5.0.9:Security Alert: Certificate is invalid - self-signed certificateContinuing execution. Use -S option for racadm to stop execution on certificate-related errors.[Key=iDRAC.Embedded.1#LDAP.1]Object value modified successfullySecurity Alert: Certificate is invalid - self-signed certificateContinuing execution. Use -S option for racadm to stop execution on certificate-related errors.ERROR: Invalid object specified.----------------------------------------Configuring iDRAC at 10.5.0.11 ...ERROR on 10.5.0.11:Security Alert: Certificate is invalid - self-signed certificateContinuing execution. Use -S option for racadm to stop execution on certificate-related errors.[Key=iDRAC.Embedded.1#LDAP.1]Object value modified successfullySecurity Alert: Certificate is invalid - self-signed certificateContinuing execution. Use -S option for racadm to stop execution on certificate-related errors.ERROR: Invalid object specified.----------------------------------------All done.\n<\/code><\/pre>\nCan you let me know what is wrong with this script or whether there should be some amendments?<\/p>","upvoteCount":2,"datePublished":"2025-06-19T10:41:08.275Z","url":"https://community.spiceworks.com/t/script-to-configure-ldap-to-multiple-idracs/1216635/1","author":{"@type":"Person","name":"spiceuser-7bks","url":"https://community.spiceworks.com/u/spiceuser-7bks"}},{"@type":"Answer","text":"
Poorly<\/p>\n
\nERROR on 10.5.0.9: Security Alert: Certificate is invalid - self-signed certificate Continuing execution. Use -S option for racadm to stop execution on certificate-related errors.
\nERROR: Invalid object specified.<\/p>\n<\/blockquote>\n
Could be try to fix the certificate it’s complaining about, and/or verify the object<\/code> specified is valid.<\/p>\nHopefully this points you in a good direction.<\/p>","upvoteCount":0,"datePublished":"2025-06-20T12:09:24.026Z","url":"https://community.spiceworks.com/t/script-to-configure-ldap-to-multiple-idracs/1216635/2","author":{"@type":"Person","name":"fallen-it","url":"https://community.spiceworks.com/u/fallen-it"}},{"@type":"Answer","text":"
Actually we don’t use certificates for iDrac.<\/p>","upvoteCount":0,"datePublished":"2025-06-20T14:20:20.808Z","url":"https://community.spiceworks.com/t/script-to-configure-ldap-to-multiple-idracs/1216635/3","author":{"@type":"Person","name":"spiceuser-7bks","url":"https://community.spiceworks.com/u/spiceuser-7bks"}},{"@type":"Answer","text":"
Well the error tells you to use -S<\/code> to stop the error message. however, reading the actual error Invalid object specified.<\/code><\/p>","upvoteCount":0,"datePublished":"2025-06-23T17:33:40.712Z","url":"https://community.spiceworks.com/t/script-to-configure-ldap-to-multiple-idracs/1216635/4","author":{"@type":"Person","name":"fallen-it","url":"https://community.spiceworks.com/u/fallen-it"}}]}}