<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Changing Domain Controllers in HPE OneView</title>
    <link>https://community.hpe.com/t5/hpe-oneview/changing-domain-controllers/m-p/7198671#M8547</link>
    <description>You just update the directoryServers collection. The updated list should can't valid domain controller addresses.</description>
    <pubDate>Fri, 13 Oct 2023 23:36:51 GMT</pubDate>
    <dc:creator>ChrisLynch</dc:creator>
    <dc:date>2023-10-13T23:36:51Z</dc:date>
    <item>
      <title>Changing Domain Controllers</title>
      <link>https://community.hpe.com/t5/hpe-oneview/changing-domain-controllers/m-p/7198621#M8541</link>
      <description>&lt;P&gt;We have our OneView appliances connected to the corporate active directory.&amp;nbsp; As the domain controllers age, they get replaced with newer systems.&amp;nbsp; So, our appliances wind up pointing to systems that are no longer domain controllers.&amp;nbsp; So, I developed this code to check them:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DCs=$(/usr/bin/dig SRV _ldap._tcp.my.org +noall +answer | awk '{ print $8 }' | sed -e '/^$/d' | grep -v 'noall' | sort -t \- -k 2,2 -k 1,1)
for SERVER in $(curl --insecure --silent --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --request GET ${Oneview}/rest/logindomains | jq -r '.members[] | .directoryServers[] | .directoryServerIpAddress'); do
   if [[ $(echo ${DCs} | grep -c ${SERVER}) -gt 0 ]]; then
      echo "This is a good domain controller, ${SERVER}."
   else
      echo "This is no longer a good domain controller, ${SERVER}."
   fi
done&lt;/LI-CODE&gt;&lt;P&gt;My question now is, how do I delete a bad domain controller and add in a new one?&amp;nbsp; Do I just make a new connection to AD with a new list of domain controllers, or can I delete one and just add one?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 04:07:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/changing-domain-controllers/m-p/7198621#M8541</guid>
      <dc:creator>bradawk1</dc:creator>
      <dc:date>2023-10-16T04:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Domain Controllers</title>
      <link>https://community.hpe.com/t5/hpe-oneview/changing-domain-controllers/m-p/7198671#M8547</link>
      <description>You just update the directoryServers collection. The updated list should can't valid domain controller addresses.</description>
      <pubDate>Fri, 13 Oct 2023 23:36:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/changing-domain-controllers/m-p/7198671#M8547</guid>
      <dc:creator>ChrisLynch</dc:creator>
      <dc:date>2023-10-13T23:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Domain Controllers</title>
      <link>https://community.hpe.com/t5/hpe-oneview/changing-domain-controllers/m-p/7198744#M8549</link>
      <description>&lt;P&gt;I tried with:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LDOM=$(curl --insecure --silent --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --request GET ${Oneview}/rest/logindomains | jq -r '.members[] | .directoryServers[] | .uri' | head -1)
#
# Get two or three domain controllers from the list:
echo ${DCs} | tr ' ' '\n'
DC1="&amp;lt;domain controller 1&amp;gt;"
DC2="&amp;lt;domain controller 2&amp;gt;"
DC3="&amp;lt;domain controller 3&amp;gt;"
DATA='{directoryServers": [{"directoryServerIpAddress":"'${DC1}'","directoryServerSSLPortNumber":"636"},{"directoryServerIpAddress":"'${DC2}'","directoryServerSSLPortNumber":"636"},{"directoryServerIpAddress":"'${DC3}'","directoryServerSSLPortNumber":"636"}]}'
curl --insecure --silent --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --request PUT ${oneView}${LDOM} | jq -r '.'&lt;/LI-CODE&gt;&lt;P&gt;and got back:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "errorCode": "AUTHN_LOGINDOMAIN_SELF_DELETE_EDIT_NOT_ALLOWED",
  "message": "Cannot delete or edit the directory settings of the current user.",
  "details": "A user belonging to a directory cannot delete or edit it.",
  "messageParameters": [],
  "recommendedActions": [
    "Login as a user of different directory and retry."
  ],
  "errorSource": "loginDomain",
  "nestedErros": [],
  "data": {}
}&lt;/LI-CODE&gt;&lt;P&gt;So, I changed my login domain to the local domain and tried again.&amp;nbsp; This time I got:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "errorCode": "AUTHN_EMPTY_LOGINDOMAIN_NAME",
  "message": "Directory service name cannot be empty.",
  "details": "Directory service name cannot be empty.",
  "messageParameters": [],
  "recommendedActions": [
    "Specify a unique directory service name."
  ],
  "errorSource": "directoryName",
  "nestedErrors": [],
  "data": {}
}&lt;/LI-CODE&gt;&lt;P&gt;I'm assuming a need more in the JSON supplied?&amp;nbsp; Just trying to determine what is missing.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 11:09:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/changing-domain-controllers/m-p/7198744#M8549</guid>
      <dc:creator>bradawk1</dc:creator>
      <dc:date>2023-10-16T11:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Domain Controllers</title>
      <link>https://community.hpe.com/t5/hpe-oneview/changing-domain-controllers/m-p/7198838#M8551</link>
      <description>&lt;P&gt;Does anyone know how to determine the directoryName or directory service name?&amp;nbsp; I'm not finding that reference in the logindomains output.&amp;nbsp; So, not really sure what it is asking for?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 12:07:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/changing-domain-controllers/m-p/7198838#M8551</guid>
      <dc:creator>bradawk1</dc:creator>
      <dc:date>2023-10-17T12:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Domain Controllers</title>
      <link>https://community.hpe.com/t5/hpe-oneview/changing-domain-controllers/m-p/7198840#M8552</link>
      <description>&lt;P&gt;I got a little further.&amp;nbsp; I have at this point:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DCs=$(/usr/bin/dig SRV _ldap._tcp.my.org +noall +answer | awk '{ print $8 }' | sed -e '/^$/d' | grep -v 'noall' | sort -t \- -k 2,2 -k 1,1)
for SERVER in $(curl --insecure --silent --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --request GET ${Oneview}/rest/logindomains | jq -r '.members[] | .directoryServers[] | .directoryServerIpAddress'); do
   if [[ $(echo ${DCs} | grep -c ${SERVER}) -gt 0 ]]; then
      echo "This is a good domain controller, ${SERVER}."
   else
      echo "This is no longer a good domain controller, ${SERVER}."
   fi
done
#
LDOM=$(curl --insecure --silent --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --request GET ${Oneview}/rest/logindomains | jq -r '.members[] | .directoryServers[] | .uri' | head -1)
DSN=$(curl --insecure --silent --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --request GET ${Oneview}/rest/logindomains | jq -r '.members[] | .name')
DTYPE=$(curl --insecure --silent --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --request GET ${Oneview}/rest/logindomains | jq -r '.members[] | .authProtocol')
#
# Get two or three domain controllers from the list:
echo ${DCs} | tr ' ' '\n'
DC1="&amp;lt;domain controller 1&amp;gt;"
DC2="&amp;lt;domain controller 2&amp;gt;"
DC3="&amp;lt;domain controller 3&amp;gt;"
DATA='{"name": "'${DSN}'","authProtocol": "'${DTYPE}'",directoryServers": [{"uri":"'${LDOM}'","directoryServerIpAddress":"'${DC1}'","directoryServerSSLPortNumber":"636"},{"uri":"'${LDOM}'","directoryServerIpAddress":"'${DC2}'","directoryServerSSLPortNumber":"636"},{"uri":"'${LDOM}'","directoryServerIpAddress":"'${DC3}'","directoryServerSSLPortNumber":"636"}]}'
curl --insecure --silent --header "X-API-Version: ${currentVersion}" --header "auth: ${sessionID}" --request PUT ${oneView}${LDOM} | jq -r '.'&lt;/LI-CODE&gt;&lt;P&gt;but this time I got:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "errorCode": "UNEXPECTED_EXCEPTION",
  "message": "An unexpected error occurred.",
  "details": "An unexpected and unhandled runtime exception occured.",
  "messageParameters": [],
  "recommendedActions": [
    "Please contact your authorized support representative and provide them with a support dump."
  ],
  "errorSource": null,
  "nestedErrors": [],
  "data": {}
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 Oct 2023 12:31:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-oneview/changing-domain-controllers/m-p/7198840#M8552</guid>
      <dc:creator>bradawk1</dc:creator>
      <dc:date>2023-10-17T12:31:14Z</dc:date>
    </item>
  </channel>
</rss>

