- Getting Started with Nano Server
- Charbel Nemnom
- 361字
- 2021-07-02 21:11:10
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 .
推薦閱讀
- Modular Programming with Python
- Mastering Objectoriented Python
- Getting Started with CreateJS
- Django Design Patterns and Best Practices
- Python金融數據分析
- Advanced Oracle PL/SQL Developer's Guide(Second Edition)
- Working with Odoo
- 青少年信息學競賽
- Learning R for Geospatial Analysis
- 軟件工程基礎與實訓教程
- 超簡單:Photoshop+JavaScript+Python智能修圖與圖像自動化處理
- MongoDB Cookbook(Second Edition)
- iOS Development with Xamarin Cookbook
- Learning Ionic(Second Edition)
- 編程風格:程序設計與系統構建的藝術(原書第2版)