Automatically deploying Windows Server 2003 and 2008 unattended

deploymentpxe-bootunattendedwindows-server-2003windows-server-2008

We are currently using PXE boots to automate the installations and reinstallations of our dedicated servers. This is working great for all Linux based systems like Debian, CentOS, VMware and Ubuntu in combination with kickstart/preseed.

However, for Windows, this seems to be impossible. You need to use WDS/MDT with Active Directory and I'm simply not looking forward to changing the entire deployment system for this.

So we're looking for alternatives to WDS/MDT which allows us to deploy customized Windows Server 2003/2008 servers in an automated fashion with settings like IP address/password/license key in a separate file so we don't have to create an image per server.

We have a Linux based deployment system which is completely incorporated into our backend/control panels etc. Hence I'm looking for a deployment solution that can run on Linux.

The guides I did find suggest booting WinPE using PXE and then using the EXE installers of Windows Server. Is this the suggested way to go or are there better ways to accomplish it?

Best Answer

Overview

You can distribute a WinPE image using pxelinux or any other PXE boot technology. That will get you a scriptable command prompt able to launch an unattended install.

You can use WAIK to create an unattend.xml file that's called during setup where you can create your own build scripts that meet whatever it is that your needs are. The unattend file can call batch or powershell scripts as well as any other application during the post-install phase for customization.

I strongly doubt that there is any commercial product that will do this. If you want to have a Windows imaging environment integrated with a Linux one, you're going to have to hand-roll a lot of it yourself. The good thing is that the tools to do it (WAIK,DISM, WinPE, etc) are all freely available.


Design Basics

You'll want to create an SMB share with a copy of the Windows OS installation files that you want to deploy. You can modify these files (incorporate patches, Windows modules, etc,) with DISM.

Once you have that, you'll want to deploy WinPE through whatever PXE solution you use. You can edit startnet.cmd in WinPE to contain whatever custom commands that you want. This cmd file is executed when WinPE loads. This will allow you to automate the install. At a minimum, you will map the SMB share with the source files

net use \\server\share

and call

\\server\share\setup /unattend:\\server\share\unattend.xml

This will run setup in unattended mode, assuming you've configured your unattend file correctly. There are many examples of how to do this on technet.

In the OOBE phase of the unattend file, you can configure autologin and call whatever build scripts you need. Slmgr.vbs can change product keys and activate, you can call netsh to set IP info, and directly in the unattend.xml, you can specify the creation of local users and groups.

This gives you a completely customizable install environment that can PXE boot from any TFTP server. It's a lot of trial and error if you've never done it before, but it can absolutely be done.