Skip to main content

New-DJoinFile

Description

This script creates a new Djoin file to accomplish an offline domain join.

Requirements

The target of this script must have the AD-Domain-Services Windows feature.

Usage

  1. If the machine is not a domain controller, log an error and exit.
  2. Obtain the domain controller's domain name.
  3. Run the Djoin.exe command using the domain name and target.
  4. If the expected file is missing, log an error and return the results of the Djoin.exe command.
  5. If the expected file is found, log the success and return the results of the Djoin.exe command.
.\New-DJoinFile.ps1 -TargetName Dev-Win10-2

This will create a file named Dev-Win10-2-OfflineJoin.txt in the working directory of this script.

Parameters

ParameterAliasRequiredDefaultTypeDescription
TargetNameTrueStringThe name of the target computer to be joined to the domain.

Output

Logs:

  • .\New-DJoinFile-log.txt
  • .\New-DJoinFile-error.txt

Console:

  • Djoin.exe command results.