- Windows Server 2016 Automation with PowerShell Cookbook(Second Edition)
- Thomas Lee
- 170字
- 2021-07-02 18:15:49
Getting ready
Before starting, you should ensure that the pre-requisites for using PowerShellGet are installed and are updated. See recipe in Chapter 1, What's New in PowerShell and Windows Server, Exploring PowerShellGet recipe for how you can achieve this.
To enable the Nano Server to join the domain, you first create a domain join blob file. Run the following command with an account in Domain Admins group, from a virtual machine on the domain as follows:
djoin.exe /provision /domain RESKIT /machine NANO2
/savefile .\NANO2.djoin
The djoin command creates the domain join blob as .\NANO2.djoin. Copy the newly created NANO2.djoin file to a folder on your Hyper-V host (C:\foo in this recipe.)
You also need the Windows Server 2016 installation ISO mounted (You use E: in this recipe as the location of this ISO image.)
A Nano Server can use DHCP or static IP addresses. In this recipe for provisioning NANO2 on the Reskit.org domain, you use the following settings:
- IPAddress: 10.10.10.132
- Subnet Mask: 255.255.255.0
- Gateway: 10.10.10.254
- DNS: 10.10.10.10/10.10.10.11