ProLiant Servers (ML,DL,SL)
1825766 Members
2068 Online
109687 Solutions
New Discussion

Change Domain Controller

 
SOLVED
Go to solution
bradawk1
Trusted Contributor

Change Domain Controller

We recently discovered that the domain controller we had configured in iLO was no longer a domain controller.  So, we got the IP address of a current one, and I used this redfish API call to make the change.  It worked well.

SERVER=my-fqdn.org
DCIP='1.2.3.4'
DATA='{"LDAP":{"AccountProviderType":"ActiveDirectoryService","ServiceEnabled":true,"ServiceAddresses":["'${DCIP}'"]}}'
ACTV=$(python3 -c "import urllib.parse, sys; print urllib.parse.quote(sys.argv[1])"'serverName' = '${SERVER}'\"")
UUID=$(curl --insecure --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --silent \
   --request GET ${OneView}/rest/server-hardware?filter=${ACTV} | jq -r '.members[] | .uuid'})
read iLOSSO iLOAuth <<< $(curl --silent --insecure --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" \
   --request GET ${OneView}/rest/server-hardware/${UUID}/remoteConsoleUrl | \
   jq -r '.remoteConsoleUrl ' | sed -e 's|hplocons|https|' -e 's|addr=||' \
   -e 's|^\(.*\)&sessionkey=\(.*\)$|\1 \2|')
# Upload to iLO
curl --insecure --silent --header "X-Auth-Token: ${iLOAuth}" --header "accept: application/json" --data "${DATA}" --request PATCH ${iLOSSO}/redfish/v1/AccountService | jq -r '.'

I actually put it in a for loop and did several racks at once.

1 REPLY 1
bradawk1
Trusted Contributor
Solution

Re: Change Domain Controller

Just marking this as not needing a reply.