
上QQ阅读APP看书,第一时间看更新
Domain join
You can also join Nano Server to a domain using the djoin.exe command line.
We have two ways of doing that:
- The first option is a blob-based domain join. It means that you should generate a blob from a domain joined machine located in the same domain, and then copy that blob over to Nano Server. Then, apply that blob to the image in offline or online mode.
- To harvest a data blob from a domain machine that is already running Windows Server 2016, from an elevated command prompt, run the following command:
djoin.exe /provision /domain <domain-name> /machine <machine-name> /savefile .\odjblob
- Next, we need to copy that harvest data blob <odjblob> into the Nano Server machine using PowerShell remoting, and then join it to the domain by running the following command:
$Session = New-PSSession -ComputerName <NanoServer> -Credential ~\Administrator
Copy-Item -ToSession $Session -Path 'C:\odjblob' -Destination C:\ -Recurse -Verbose
$Session | Enter-PSSession
djoin /requestodj /loadfile C:\odjblob /windowspath c:\windows /localos
shutdown /r /t 5
Exit-PSSession
- The second option is to generate a blob on a machine that is joined to the same domain as well, and then open that blob file <odjblob> that you generated and copy its content inside the unattend.xml file under the <AccountData> section, as shown in Figure 13. Then, use that unattend.xml file to apply the domain join on boot in the Nano Server image.
- To harvest a data blob from a domain machine that is already running Windows Server 2016, we need to use the same step as described previously with djoin.exe command:

Figure 13: Nano Server domain join, unattend.xml
- Add the contents of the odjblob file to the unattend.xml file
- Inject the unattend.xml file into the Nano Server image as discussed earlier
I f you have multiple Nano Servers that you want to join to the domain, you should generate one blob for each Nano machine, because the blob has computer name information. If you specify a blob using the unattend.xml file as shown in Figure 13, you cannot specify a computer name in the unattend.xml file as well. This will contradict, as the blob already holds the computer name when you are generating it from the djoin.exe .