Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

Remote Domain Join - RemoteADJoin

Overview

This program pair is used to remotely domain join a machine without direct access to the domain using the Kaseya API by running on the endpoint and the domain controller (DC).
The endpoint requires a restart.
This will rename the machine if specified; otherwise, the machine will use its existing computer name.

Process

GetDCKaseyaNameAPI.exe

This executable uses the API to get its own agent details. It uses its organization ID to retrieve the most common domain in the organization, then gets the DC for that domain.
The executable then pushes its details to that DC using the API and the DC's agent GUID and executes an agent procedure on that DC.
Finally, the executable waits for its own domain join payload file to appear in its API documents folder, at which point it will domain join the machine.
If the program does not see the payload file after 10 minutes, it will terminate.

CreateDJOINFileAPI.exe

This executable is called by an agent procedure triggered from another executable on the endpoint.
It retrieves all the detail files from its API documents folder and then creates payloads for those that do not have payloads on the endpoint.
Once no files need to be created, it cleans up its managed files (the files it acted upon) and then closes itself after uploading the payloads to the endpoint.

Parameters

GetDCKaseyaName

ParameterRequiredDefaultTypeDescription
agentguidtrueStringThis is an agent GUID you need to push to the script from the endpoint
urltrueStringThe URL for our API connection
usernametrueStringThe username for our API connection
passwordtrueStringThe password for our API connection
renametypefalseStringSet to SERIAL for Serial, set to COMPUTERNAME for computer name; otherwise, the program will take input as the computer name
customdomainfalseStringInput the domain name you wish to join; there must be a domain controller for this domain in that organization

GetDCKaseyaName

ParameterRequiredDefaultTypeDescription
agentguidtrueStringThis is an agent GUID you need to push to the script from the endpoint
urltrueStringThe URL for our API connection
usernametrueStringThe username for our API connection
passwordtrueStringThe password for our API connection

Output

Output files for the endpoint are located in the same directory as the executable:
./{YOURAGENTGUID}-EndpointCompName.txt - local file for DC to create the djoin file
./RemoteADJoin_CreateDJOINFile-log.txt - log file for endpoint
./{YOURAGENTGUID}Z-DJoinPayload.txt - the djoin file

Locations

Executable EndpointExecutable DC
RemoteADJoin-CreateDJOINFileAPI.exeRemoteADJoin-GetDCKaseyaNameAPI.exe
AutomateN/A
Kaseya endpoint procedureShared / PVAL Stack / Tool Set - Global / Remote Domain Join
Kaseya DC procedureShared / PVAL Stack / Tool Set - Global / Remote Domain Join