You are here:   Research
  |  Login

Welcome to my blog, quickest way to find articles is usually to search for them.

Search in All Title Contents

Deploy Nano Server using MDT 2013 Update 2

Aug 08 2015

In this guide you learn learn how to deploy the Nano Server using MDT 2013 Update 2, including domain join. The article has three main parts to it:

  • Create the Nano Server reference image
  • Add the image to the MDT deployment share, and create a custom task sequence for the Nano Server.
  • Deploy the Nano Server

Disclaimer: This is not a supported scenario from Microsoft, so don’t contact them if you run into any issues :)

Note #1: If I also written a follow-up post on how to create a bootable ISO of the Nano Server. However, this article is pre-requisite for that blog post.

Enterprise deployment challenges

For some odd reason, Nano Server is not ready for enterprise deployment using standard deployment solution like MDT or ConfigMgr. Even normal domain join features are stripped out of it, only offline domain join is supported. Meaning you are forced to do some serious hacks to get the domain join going in an automated fashion. The most promising hack, so far, for automating the offline domain join, is the following GitHub project:


Which is described on this blog:

Part 1: Nano Server Domain Join (Deployment-at-a-scale an introduction)

Step 1 - Create the Nano Server reference image

Normally I would use MDT to build the server reference image, but since the Nano Server does not have sysprep, nor can run the MDT task sequence engine, I ‘m using PowerShell instead. The PowerShell script in this section creates a Nano Server reference image that includes the Nano Server storage package.

In this scenario my MDT01 server is a Windows Server 2012 R2 machine to which I have installed the Windows ADK 10 into the default location. I have also copied the NanoServer folder from the Windows Server 2016 Technical Preview 5 media to the F:\Downloads\Windows Server 2016 TP5 folder. Simply run the New-NanoServerRefImage.ps1 script in an elevated PowerShell prompt.

NanoServer folder from the Windows Server 2016 Technical Preview 5 media copied to C:\Setup.

The NanoServer.WIM reference image created by the New-NanoServerRefImage.ps1 script.

Here is the New-NanoServerRefImage.ps1 script I’m using to create a reference image including the File Server and other storage support:

# Create Nano Server WIM image with the File Server role and other storage components

# Specify the source folder for Windows Server 2016 media and change working directory to that folder
$WS2016Media = "F:\Downloads\Windows Server 2016 TP5"
Set-Location "$WS2016Media\NanoServer"

# Import the Nano Server Image Generator module
Import-Module .\NanoServerImageGenerator -Verbose

# Create a new WIM file with Nano Server with File Server support (the storage package)
# For a full list of packages, go to
$BasePath = "C:\Setup\Nano\Base"
$WimFile = "C:\Setup\Nano\Nano.wim"
$AdminPassword = ConvertTo-SecureString -AsPlainText "P@ssw0rd" -Force
New-NanoServerImage -Edition Standard -DeploymentType Guest -MediaPath $WS2016Media -BasePath $BasePath -TargetPath $WimFile -ComputerName REF001 -AdministratorPassword $AdminPassword -Storage


Step 2 – Add the Nano Server image and create the custom Nano Server task sequence

In this guide I’m assuming you have installed Windows 10 ADK, MDT 2013 Update 2 and created a deployment share. In my example I was using the E:\MDTProduction folder for my deployment share.

1. Import the Nano.wim you created in step one to the deployment share. Import the Nano.wim is a custom image, without any setup files.

Nano Server reference image added.

2. Create a custom task sequence with the following actions:

  • Gather (local only)
  • Format and Partition Disk actions, both BIOS and UEFI (copy from a standard server task sequence)
  • Configure
  • Install Operating System
  • Offline Domain Join (Run Command Line action: PowerShell.exe -ExecutionPolicy ByPass -File JoinDomainOffline.ps1)

Note: Since the JoinDomainOffline.ps1 script is run during WinPE, you need to add PowerShell and .NET support to your MDT boot image.

Here is the JoinDomainOffline.ps1 script:

# Determine where to do the logging 
$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment 
$logPath = $tsenv.Value("LogPath") 
$logFile = "$logPath\$($myInvocation.MyCommand).log"
# Start the logging 
Start-Transcript $logFile
Write-Output "Logging to $logFile"
# Join the computer to the domain
$OSDisk = $tsenv.Value("OSDISK")
$OSDComputerName = $tsenv.Value("OSDComputerName")

If (Test-Path $DEPLOYROOT\OfflineDomainBlobs\$OSDComputerName.blob){
    # Offline Domain Join blob found, OK, continuing...
    $DJoinExe = "$OSDisk\Windows\System32\djoin.exe"
    & $DJoinExe /requestodj /loadfile "$DEPLOYROOT\OfflineDomainBlobs\$OSDComputerName.blob" /windowspath "$OSDisk\Windows"
Else {
    Write-Warning "Oupps, Offline Domain Join blob not found, doing nothing..."

# Stop logging 

The custom Nano Server task sequence.

3. Copy an Unattend.xml file from another (normal) Windows Server 2016 task sequence to the Nano Server task sequence folder. In my example, I copied the unattend.xml to E:\MDTProduction\Control\NANO-001.


Step 3 - Deploy the Nano Server

Once the task sequence is created you can deploy the Nano Server as any other operating system. In my environment I configured my CustomSettings.ini file to prompt for the Nano Server computer name, to show the Final Summary Screen and to restart when completed (FinishAction=RESTART). Once the deployment is completed, the Nano Server will reboot twice, then it’s done.

1. If you want the Nano Server to join your domain create the offline domain join blob in Active Directory by running the following script on a machine that is a member of your domain (modify the script to match your domain).

NewOfflineJoinDomainBlob.ps1 –ComputerName Nano-001

The NewOfflineJoinDomainBlob.ps1 script:


$machineOU = "OU=Servers,OU=ViaMonstra,DC=corp,DC=viamonstra,DC=com"
$DomainName = ""
$BlobFolder = "E:\MDTProduction\OfflineDomainBlobs"

djoin.exe /provision /domain $DomainName /machine $ComputerName /machineOU $machineOU /savefile "$BlobFolder\$ComputerName.blob"

Creating the Offline Domain Join Blob.

2. Start a normal MDT deployment, select the Nano Server task sequence, and assign the same name to the computer as the offline join blob you created earlier.

Note: The deployment time is about 1 minute :)

Assigning the Nano Server computer name during the Windows Deployment Wizard.

The Nano Server login screen.

Nano Server deployed, this screen is after logging in to to the machine.

Accessing the File Server on NANO-001.

Happy deployment, and thanks for reading!

What our lawyers makes us say:

This information is provided "AS IS" with no warranties, confers no rights and is not supported by the authors or Deployment Artist.

Copyright © 2017 by Deployment Artist (the company behind deployment research). All rights reserved. No part of the information on this web site may be reproduced or posted in any form or by any means without the prior written permission of the publisher.

Shorthand: Don't pass off our work as yours, it's not nice.

Blog Archive