- Getting Started with Nano Server
- Charbel Nemnom
- 163字
- 2025-04-04 19:01:39
Customizing a Nano image using unattend.xml file
To customize Nano Server using DISM so you can manage it remotely, you need to set an administrator password.
The simplest way is using an unattend.xml file, as shown in the following example:
<?xml version='1.0' encoding='utf-8'?>
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<settings pass="offlineServicing">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<ComputerName>NanoServer01</ComputerName>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<UserAccounts>
<AdministratorPassword>
<Value>Passw0rd!</Value>
<PlainText>true</PlainText>
</AdministratorPassword>
</UserAccounts>
<TimeZone>Romance Standard Time</TimeZone>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<RegisteredOwner>My Team</RegisteredOwner>
<RegisteredOrganization>My Corporation</RegisteredOrganization>
</component>
</settings>
</unattend>
In this sample, the unattend.xml file does not add the Nano Server to a domain. Therefore, you should use it if you want to run the Nano Server as a standalone machine or if you want to wait and join it later to a domain. The values for ComputerName and AdministratorPassword are merely examples.
Please note that by using unattend.xml you can also include domain join information. We will get into that in a bit.
The unattend.xml file must be placed under the C:\Windows\panther folder in the Nano Server image.
You can download a sample of unattend.xml file for standalone and domain joined as a companion to this book.