Join Domain [Online/Offline]
Summary
The Join Domain [Online/Offline] automation is used to join a Windows computer to an Active Directory domain using either the online credential-based method or the offline domain join method.
The automation uses a Kaseya VSA agent procedure to collect the required parameters, create a JSON configuration file, and execute the Join-Domain-KI.ps1 wrapper script. The wrapper retrieves the agnostic Join-Domain.ps1 script from the ProVal Content Repository, validates its code signature, and executes it with the configured parameters.
The automation supports the following methods:
- Online Domain Join: Uses the domain name and domain credentials to join the computer to the domain.
- Offline Domain Join: Uses a previously generated offline domain join file to join the computer to the domain.
Sample Run

Note: The computer must have the required network connectivity and DNS configuration to locate the domain controller when using the online method. The offline method requires a valid offline domain join file.
Dependencies
- Agnostic script - Join Domain
- For the offline method, an offline domain join file generated using the Generate DJoin File [Domain Controller]
Variables
| Variable | Description |
|---|---|
DomainName | Specifies the Active Directory domain to join. |
DJoinFilePath | Specifies the path to the offline domain join file. |
Username | Specifies the username used for the online domain join. |
Password | Specifies the password associated with the domain join account. |
The VSA procedure collects these parameters and writes the available values to Join-Domain-Param.Json. The wrapper converts the username and password into a PSCredential object before passing the parameters to the agnostic script.
Working paths:
- Working directory:
C:\ProgramData\_Automation\Script\Join-Domain - Wrapper script:
C:\ProgramData\_Automation\Script\Join-Domain\Join-Domain-KI.ps1 - Parameter file:
C:\ProgramData\_Automation\Script\Join-Domain\Join-Domain-Param.Json - Downloaded script:
C:\ProgramData\_Automation\Script\Join-Domain\Join-Domain.ps1
Implementation
-
Export the agent procedure from ProVal's VSA RMM instance.
Name:
Join Domain [Online/Offline]The export downloads the required XML file.
-
Import the XML file into the partner's VSA RMM instance.
-
Export the
Join-Domain-KI.ps1wrapper script from ProVal's Internal VSA.The script is available under:
Manage Files>Shared Files>PVAL>Join-Domain-KI.ps1 -
Ensure that
Join-Domain-KI.ps1is mapped to the appropriate file path in the client's VSA environment.The agent procedure writes this file to:
C:\ProgramData\_Automation\Script\Join-Domain\Join-Domain-KI.ps1 -
Configure the parameters according to the selected domain-join method.
For Online Domain Join:
- Provide
DomainName. - Provide
UsernameandPasswordfor the domain account. - Ensure the target computer has network connectivity and DNS configured to locate a domain controller.
For Offline Domain Join:
- Run the Generate DJoin File [Domain Controller] agent procedure on the Domain Controller.
- Provide the target computer name for which the offline domain join file needs to be generated.
- Locate the generated offline domain join file
TargetName-OfflineJoin.txton Domain Controller under pathC:\ProgramData\_Automation\Script\New-DJoinFile. - Place the
TargetName-OfflineJoin.txtfile on the target computer and note its full path. - Run the
Join Domain [Online/Offline]procedure on the target computer. - Provide
DJoinFilePathto the full path of the offline domain join file placed on target computer. - Execute the procedure and review the VSA procedure log to verify the result.
For detailed instructions, refer to the Generate DJoin File [Domain Controller].
- Provide
-
Run the
Join Domain [Online/Offline]agent procedure against the target Windows computer. -
Verify the execution results in the VSA procedure log. If the domain join fails, review the logged error and check domain controller discovery, DNS configuration, network connectivity, credentials, and the offline join file path as applicable.
Output
- Procedure logs
Changelog
2026-10-27
- Initial version of the document.