Host Active Directory Authentication Join Domain Task

Host Active Directory Authentication Join Domain Task

Adds the host to an Active Directory domain.

If the HostAuthenticationStoreInfo.enabled property is True (accessed through the info property), the host has joined a domain. The vSphere API will throw the InvalidState fault if you try to add a host to a domain when the host has already joined a domain.

Required privileges: Host.Config.AuthenticationStore

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/HostActiveDirectoryAuthentication/{moId}/JoinDomain_Task
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case HostActiveDirectoryAuthentication/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 8.0.2.0 APIs.


Request Body
JoinDomainRequestType of type(s) application/json
Required
{
    "domainName": "string",
    "userName": "string",
    "password": "string"
}
string
domainName
Required

Name of the domain to be joined.

string
userName
Required

Name for an Active Directory account that has the authority to add hosts to the domain.

string As password As password
password
Required

Password for the userName account.

Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns MoRefTask of type(s) application/json
This response body class contains all of the following: MoRefExtensibleManagedObject
{
    "_typeName": "string",
    "type": "string",
    "value": "string"
}

500

InvalidState: if the host has already joined a domain.

BlockedByFirewall: if ports needed by the join operation are blocked by the firewall.

HostConfigFault: if the host configuration prevents the join operation from succeeding.

InvalidLogin: if userName and password are not valid user credentials.

DomainNotFound: if the domain controller for domainName cannot be reached.

NoPermissionOnAD: if userName has no right to add hosts to the domain.

InvalidHostName: if the domain part of the host's FQDN doesn't match the domain being joined.

ClockSkew: if the clocks of the host and the domain controller differ by more than the allowed amount of time.

ActiveDirectoryFault: for any problem that is not handled with a more specific fault.

TaskInProgress: if the HostActiveDirectoryAuthentication object is busy.

Returns VimFault of type(s) application/json
This response body class contains all of the following: MethodFault
{
    "_typeName": "string",
    "faultCause": "MethodFault Object",
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}