Q. What are the commands to create a new Nano Server image using Windows Server 2016 RTM?
A. The PowerShell below creates a new Generation 1 (VHD) disk to be used with Hyper-V. In this example I add Storage, DSC, Windows Defender and add remote management support. It is deployed as Standard edition SKU. It is also joining a domain using an existing AD account.
$adminPass = ConvertTo-SecureString "Pa55word" -AsPlainText -Force
$NanoVHDPath = ".\NanoServerVM.vhd"
import-module D:\NanoBuild\NanoServerImageGenerator.psm1
New-NanoServerImage -MediaPath 'S:\OS Images\Windows Server 2016 RTM\Expanded' `
-BasePath .\Base -TargetPath $NanoVHDPath -ComputerName NanoVM `
-DeploymentType Guest -Edition Standard `
-Storage -Defender -EnableRemoteManagementPort `
-Package Microsoft-NanoServer-DSC-Package `
-UnattendPath .\unattend.xml `
-AdministratorPassword $adminPass -DomainName savilltech -ReuseDomainNode
0 comments
Hide comments