Advertisements
BTNHD News

Offline Domain Join with MDT 2013 and Windows Operating System

Adding computers to the domain is difficult when the computers are not part of your network and don't have access to the Active Directory infrastructure. We have to come up with a solution on how to join computers to the domain offline.

Okay, to do this we will need to create two PowerShell scripts. One script will provision the computer into your Active Directory and the other script is to run the djoin command on the offline client in order to perform the offline join operation.

Step One: Provision a computer


$MDTJoinComputerNameFileLocation="C:\DeploymentShare\Scripts\BTNHD"

$data=gc c:\DeploymentShare\Scripts\BTNHD\ComputerName.txt
$data | foreach {
write-host "ComputerName" $_
invoke-expression "djoin /provision /domain bjtech.edu /machine $_ /REUSE 
/savefile $MDTJoinComputerNameFileLocation\$_"
}

Step Two: Re-run the DJoin command with in Task Sequence


$working=split-path -parent $MyInvocation.MyCommand.Definition
$computer = gc env:Computername
$sysroot = gc env:systemroot
$strfile=join-path $working "BTNHD\$computer"
invoke-expression "djoin /requestODJ /loadFile $strfile /windowspath 
$sysroot /localos"
Advertisements
About BjTechNews (891 Articles)
An IT guy trying to learn everything about technology and sharing it with you all. I'm a blogger and video blogger who highlights daily news in the tech industry, promoting tips and hacks for fellow techies.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s