Windows NANO server 2016 - Join NANO server to domain by offline domain join tool and powershell

Опубликовано: 16 Февраль 2017
на канале: IT Man
573
4

Step by step guide, how join Windows Server 2016 NANO server to domain using DJOIN.EXE and powershell.

Powershell script from video:



#Create DNS record for NANO server

#Create offline domain join
djoin.exe /provision /domain contoso.com /machine nano1 /savefile c:\temp\odjblob

#Connect to Nano Server

Set-Item WSMan:\localhost\Client\TrustedHosts "10.10.10.10" -Concatenate

#Transfer offline Djoin to NANO
$filePath = 'c:\temp\odjblob'
$fileContents = Get-Content -Path $filePath -Encoding Unicode

$session = New-PSSession -ComputerName 10.10.10.10 -Credential nano1\administrator

Invoke-Command -Session $session -ArgumentList @($filePath,$fileContents) -ScriptBlock {

param($filePath,$data)

New-Item -ItemType directory -Path c:\temp

Set-Content -Path $filePath -Value $data -Encoding Unicode

}


#Connect to NANO server
Enter-PSSession -ComputerName '10.10.10.10' -Credential nano1\administrator


#Join NANO server to domain
djoin /requestodj /loadfile c:\temp\odjblob /windowspath c:\windows /localos

shutdown /r /t 0