Windows Imaging Toolkit
PowerShell Batchfile
Latest commit 2ad69a3 Jan 25, 2017 @helge000 helge000 committed on GitHub Merge pull request #39 from squarit/add-windows-2016
Add support for windows server 2012 and 2016
Permalink
Failed to load latest commit information.
doc Fixed a few typos Nov 6, 2016
foreman @ 1bd8f0f Update foreman-wimaging templates sha Apr 1, 2016
images Loooooooooots of changes. Feb 9, 2015
inc Add support for windows server 2012 and 2016 Jan 13, 2017
install Fix typo Sep 26, 2015
licenses change license to GPL, Added some Acknowledgments Nov 11, 2015
sources/windows-pe-x64 Modify Push-Wim to handle winpe's; cleanup configs Sep 27, 2015
tools @ be3528b Update tools Mar 31, 2016
.gitattributes Normalize line endings Oct 1, 2015
.gitignore Normalize line endings Oct 1, 2015
.gitmodules change tools to be a submodule Feb 12, 2016
Add-Drivers.ps1 Loooooooooots of changes. Feb 9, 2015
Add-Features.ps1 Adding support for enabling/disabling image features Aug 5, 2015
Add-Tools.ps1 Loooooooooots of changes. Feb 9, 2015
Add-ToolsVHD.ps1 Loooooooooots of changes. Feb 9, 2015
Add-Updates.ps1 Loooooooooots of changes. Feb 9, 2015
Backup-WorkWim.ps1 Loooooooooots of changes. Feb 9, 2015
Capture-Wim.ps1 Loooooooooots of changes. Feb 9, 2015
Del-Features.ps1 Adding support for enabling/disabling image features Aug 5, 2015
Get-DismFeatures.ps1 add stuff May 1, 2014
Get-WimInfo.ps1 Add 'SafeUnmountWim', fix 2012r2 wim indexes, add default 'no' to unm… Jun 2, 2015
Init-InstallSources.ps1 Loooooooooots of changes. Feb 9, 2015
Init-PxeTools.ps1 Loooooooooots of changes. Feb 9, 2015
Init-Updates.ps1 Loooooooooots of changes. Feb 9, 2015
Init-WorkWim.ps1 Loooooooooots of changes. Feb 9, 2015
MountUnmount-VHD.ps1 Loooooooooots of changes. Feb 9, 2015
MountUnmount-Wim.ps1 Loooooooooots of changes. Feb 9, 2015
Prepare-Image.ps1 Loooooooooots of changes. Feb 9, 2015
Push-Wim.ps1 Loooooooooots of changes. Feb 9, 2015
Push-WimBoot.ps1 Loooooooooots of changes. Feb 9, 2015
README.md Fixed a few typos Nov 6, 2016
Revert-WorkWim.ps1 Loooooooooots of changes. Feb 9, 2015
Save-InstallWim.ps1 Loooooooooots of changes. Feb 9, 2015
Show-Menu.ps1 Initial rewrite / fixes Sep 25, 2015
Unmount-VHD.ps1 Loooooooooots of changes. Feb 9, 2015
Unmount-Wim.ps1 add stuff May 1, 2014
Update-All.ps1 Add 'SafeUnmountWim', fix 2012r2 wim indexes, add default 'no' to unm… Jun 2, 2015
Update-BootAll.ps1 Loooooooooots of changes. Feb 9, 2015
run-wimaging-shell.cmd Initial rewrite / fixes Sep 25, 2015

README.md

Provision Windows hosts with Foreman

Join the chat at https://gitter.im/kireevco/wimaging

Introduction

wimaging is a set of scripts to prepare WIM images and templates for Foreman to provision Windows hosts. Most of the time official Microsoft deployment tools are used; mostly dism.exe.

All relevant configuration files like unattend.xml are rendered by Foreman and downloaded at build time.

Features

  • Linux style installation using http:// or ftp:// installation media
  • No extra servers like WDS needed - all relevant settings can be configured in Foreman directly
  • Official Microsoft utilities are used for all relevant setup stages making it easy to add (future) operating systems
  • Driver installation during build time
  • Support for localization settings (like time zone, locale, UI language)
  • Optional domain join including target OU
  • Optional local user creation
  • Support for Foreman's root password using Base64 encoding
  • Correctly report finished host building
  • Optional software installation and user tasks at the end of the build (like installing puppet etc)

Prerequisites:

The list requirements for using Foreman, all of them are not covered by this guide.

  • A working Foreman version 1.8+ installation (obviously), capable of net booting clients along with a working DNS / DHCP infrastructure
  • Currently, Safe Mode Render must be disabled in foreman
  • A utility Windows VM or physical host to prepare the WIM images (Microsoft likes the term Technician Computer)
  • A file server serving http and/or ftp protocols; fast machine recommended for production
  • Installation media for each Windows version
  • Driver files (.inf) you want to inject
  • A VM / bare metal machine to test your setup (start with VMs ;)

Getting started with wimaging

The tasks can be broken down in two steps:

1. Configure wimaging and create WIM images

2. Configuring Foreman

Script Reference

Provision work flow

An outline of the process to better understand the tasks witch need to be done. Basically, there are three phases:

Phase I

  1. Create a new host in Foreman.

Simple as that. For Bare Metal hosts Foreman discovery is recommended.

Phase II

  1. PXE / wimboot boots customized boot.wim (winpe)
  2. Winpe downloads the script foreman_url('script'); executes it:
    1. Drive 0 is cleaned, partitioned and mounted using foreman partition table (simple diskpart script)
    2. install.wim is downloaded via http/ftp and applied using dism.exe
    3. unattend.xml (foreman_url('provision')) is download and applied using dism.exe
    4. Drivers are downloaded and added using dism.exe
    5. Required tools are added to the new host (most prominently wget)
    6. Optionally, download extra software (like puppet)
    7. Optionally, domain join script (foreman_url('user_data'))
    8. The finish script (foreman_url('finish')) is download and 'armed'
  3. reboot to new OS

Phase III

  1. Windows native finish tasks are done ('starting devices...')
  2. The finish script gets called by SetupComplete.cmd
    1. Set the time server; sync time
    2. Optionally, the local administrator account is activated
    3. Optionally, join domain
    4. Optionally, execute extra scripts (eg, install puppet)
    5. Securely cleanup (sensitive) scripts using SDelete.exe
  3. Reboot the host; ready for further configuration by Puppet, SCCM ect.

Acknowledgments

wimaging has a merged a fork of wimaging-ng. Many thanks to Daniel Helgenberger for a large contribution portion. SDelete and other PStools by SysInternals are the work of Mark Russinovich.

License

wimaging license

Other licenses: