MSEndpointMgr

MDT Factory Tool 1.0.0 – Create Reference Images

During the past 2 months I’ve been working on a new tool that will assist ConfigMgr administrators with creating reference images. You may know that there’s various methods that you could use to create a reference image that would later be used for OSD in ConfigMgr. There’re administrators out there who may be using the native Build & Capture method in ConfigMgr, but to me it makes more sense to leverage MDT in order to create my reference images. Since I’ve been doing this for quite some years now, and recently started working as a consultant, I figured that there must be an easier and faster way to get your reference image creation environment up and running. Today I present to you what I’ve been working on for the past 2 months, the MDT Factory Tool 1.0.0.
Now you may wonder, what does this MDT Factory Tool actually do?
The whole idea I had around this tool was to have a single graphical interface where one would configure how the reference image creation environment (consisting of MDT, ADK and WSUS) would function. Once you’ve made your configuration in the tool, it would simply just begin installing all of the components, configure them accordingly. When the tool has done it’s magic, you’d take the ISO file generated by MDT and boot from it on a Virtual Machine. From there the process of creating a reference image would start and when it has completed, you’d end up with a WIM file that could be imported in ConfigMgr.

Who is this tool for really?

I must be frank and tell you that this tool should not be seen as replacement if you already have a method of creating reference images in place. The primary audience for this tool are the administrators that yet haven’t figured out how they should go about creating reference images. So if you’re still using the install.wim right of the ISO, this tool is for you.
Before I go ahead and show you how to leverage this tool, I’d like to give a BIG thank you to all of the beta testers. I received a lot of great input form you guys, and some of the ideas has been implemented in version 1.0.0. I really appreciate you taking your time to assist me with making this an even better tool for the community.
107_1

Download the tool

You’ll find the tool on the TechNet Gallery, more specifically at this link.

Documentation

I’ll divide this documentation into sections based upon the tabs available in the tool. You will see me refer to something that I call the reference image creation process quite often in this documentation. This process covers all the steps invovled from when you boot the virtual machine with the boot image, until the WIM file has been created.

General tab

On the General tab, you’d need to locally browse for the Microsoft Deployment Toolkit 2013 setup file and Windows ADK 8.1. In addition to the setup files, you have the option to choose what Reference Image creation mode to use. Here you have the option to select either Manual (default) or Automatic. If you’ve any experience with MDT previously, you’ve probably seen the wizard pages that are shown during the process of delivering an Operating System, or when you create a reference image. For those of you who haven’t, the Manual mode will configure MDT to only show the Task Sequences and Applications wizard pages. If you select Automatic on the other hand, you would first need to import an Operating System (done from the Operating Systems tab), and then select an Operating System from the Mandatory Operating Systems drop down menu. Something to notice, if you choose the default mode (Manual), but doesn’t import any Application (done from the Applications tab), the Applications wizard page will not be shown in the reference image creation process.

MDT tab

This tab gives you options to configure the installation of MDT. You can specify the path to where the Deployment Share will be created, in addition to what name to use for the Deployment Share. If you require to use PowerShell scripts in the task sequence (this tool doesn’t need PowerShell to function), you have the option to enable that in the boot image (WinPE). When it comes to the Scratch space part, this is something that from WinPE 5.0, we don’t have to take into consideration any longer. To be honest, I left the functionality exist in this release of the tool, just because I didn’t have any other functionality to replace it with. Something more important though, is the User Configuration part. Here you’ll enter the username and password for a local user that will be configured to connect to the Deployment Share during the reference image creation process. Without this user account, nothing will work.

WSUS tab

The WSUS tab gives you the functionality to select which products to download patches for, and in which languages. In addition you’ll also have to specify where the WSUS content will be stored. Update Classifications are also something that you can select in this tab.

Applications tab

On the Applications tab, you’ll have to browse for a CSV file containing all the information about the applications that will be installed during the reference image creation process. The CSV file needs to be formatted in a specific way, see below:
107_2_1
You’d need to format it in the exact way as I’ve done in the picture above, or the tool may not import it correctly. In addition, the specified SourcePath for each application will be validated if it exists, and if it doesn’t, that particular application will not be imported. Here’s a more detailed overview:
Name: <name of the application>
SourcePath: <local path to where the application source files can be found>
ShortName: <short name of the application>
CmdLine: <command line that will silently install the application>

Operating Systems tab

As well for the Operating Systems tab, you’ll have to browse for a CSV file containing all the information about the operating systems that will be used. For each operating system that you import, a task sequence with the same name as the operating system will be created using that operating system. If the operating system has more than 1 index, during the import into MDT, it will show you all available choices and ask you to select which to use in the task sequence. The CSV file needs to be formatted in a specific way, see below:
107_3
You’d need to format it in the exact way as I’ve done in the picture above, or the tool may not import it correctly. In addition, the specified SourcePath for each application will be validated if it exists, and if it doesn’t, that particular application will not be imported. Here’s a more detailed overview:
Name: <name of the operating system>
ID: <ID should not be longer than 16 characters>
SourcePath: <local path to where the source contents from the operating system ISO is located>
FullName: <company user name>
OrgName: <organization name>
HomePage: <should be specified as about:blank unless you want a specific home page in IE>
AdminPassword: <local admin password>

How to use it

Since this tool has been developed with PowerShell, you would need to run it from a PowerShell console. The purpose of this tool is to create an environment where you can create reference images, and for that you need to have a Windows Server 2012 or Windows Server 2012 R2 member server installed before hand. Once you have that member server installed, you can go ahead to run this tool. Before you run it though, make sure that you’re logged on with a domain user account that’s a member of the local Administrators group and that there’s no restart pending. The tool will check for this, and throw and error.
1. Install a member server with either Windows Server 2012 or Windows Server 2012 R2.
2. Download the tool from the TechNet Gallery and store it in C:\Scripts.
3. Open an elevated PowerShell console and run the following command:

.\Create-MDTFactoryGUI_v1.0.0.ps1

4. Browse for the Microsoft Deployment Toolkit setup file (needs to be download prior).
107_4
5. Browse for the Windows Assessment and Deployment Kit setup file (needs to be downloaded prior).
107_5
6. Go to the Operating Systems tab, and browse to the CSV containing information about the Operating Systems that will be imported.
107_6
7. If you’re going to make use of the Automatic mode, go back to the General tab and select which Operating System to use.
107_7
8. Configure the settings on the MDT tab accordingly to your wishes, and do the same for the WSUS tab.
107_8
107_9
9. If you wish to import any Applications, go to the Applications tab and browse for the CSV file containing all information about the Applications.
107_10
10. Click on the Validate button.
107_11
11. Once all of the validation checks have been Passed, go ahead and click on the Start button.
12. The tool will now start to install and configure the environment.
13. Once the tool has completed, go to C:\DeploymentShares\MDTFactory\Boot and select either LiteTouchPE_x64.iso or LiteTouchPE_x86.iso depending the architecture of the operating system that you’ll be creating a reference image of.
14. Boot the virtual machine from this iso and watch the magic happen.
That’s all!

Nickolaj Andersen

Chief Technical Architect and Enterprise Mobility MVP since 2016. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows devices and deployments including automation. Awarded as PowerShell Hero in 2015 by the community for his script and tools contributions. Creator of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService to name a few. Frequent speaker at conferences such as Microsoft Ignite, NIC Conference and IT/Dev Connections including nordic user groups.

27 comments

  • Hey, got it working great on win 7,win 8.1 and win 10 – using mdt build 8298 and adk 10
    but fails miserably on server 08r2 12 and 12r2
    should I use a previous version of mdt and adk on these os?
    Thanks

  • Cool tool! I’m having trouble running it though. Last few lines of the log:
    INFO: Successfully amended the CustomSettings.ini settings
    INFO: Adding mandatory Task Sequence to CustomSettings.ini
    INFO: Starting to install Windows ADK, this will take some time
    INFO: Successfully installed Windows ADK
    INFO: Starting to update the Deployment Share ‘MDTFactory’
    ERROR: Unable to open the specified WIM file.
    Here’s my setup:
    OSE: Windows Server 2012 R2
    ADK 8.1
    MDT 2013 (build 6.2.5019.0)
    Imported OS: Windows Server 2012 Standard
    Any ideas why the I’m getting this error?
    Thanks!
    J

  • I have an MDT environment already up. Can this be used in an exiting environment or this only applicable to new builds?
    Thanks!

  • Hi,
    I’m still using MDT 2012U1 and WAIK to deploy Windows 7. I wonder if I can use your nice tool for that?
    Thx
    Gyz

    • Hi Gyz,
      Why not use the tool to install a new environment with MDT 2013 and ADK 8.1? That’s the purpose of this tool anyways. MDT 2013 supports Windows 7 SP1, so you should be good to go.
      Regards,
      Nickolaj

      • I have a couple of decentralized and customized MDT2012 servers for deploying the W7 company image But I can follow your advice and create the reference image with your tool (MDT 2013/ADK) and then import the captured image on my MDT2012 deploy servers. That should pose no problem I guess…?
        Many thanks!

  • Great tool – thank you for this!
    We don’t use WSUS though (3rd party patching is done with Windows patching by another tool) and this is causing the process to break during the creation of the Dist. Share – can the WSUS tab be Shut Off using a checkbox or what can I remove/disable to turn it off?
    Thanks!
    Chris

    • Hi Chris,
      Great feedback, I’ll put this on my todo list. There’s a new version coming out soon with some various enhancements, will make sure to include this as well.
      Regards,
      Nickolaj

    • Hi again Chris,
      I’m looking into this feature that you’ve requested and was wondering, would you be using the Windows Update steps that’s a part of the Task Sequence, or do you plan to implement a custom step that works with your 3rd party patching tool? If you could share some more information on how it works, it would make it easier for me to implement the feature that you’ve requested.
      Thanks in advance.
      Regards,
      Nickolaj

      • Hi Nickolaj
        Sorry for the delay in replying… IT is a busy world –
        We use a 3rd party patching tool (NCentral) but using that would be overkill in this process – just allowing access to use the MS Windows update from the Microsoft site is more that enough. Right now, we use the Windows Update steps in the Task Sequence which does the trick. Our GPO to push updates will pull the ones we don’t want to use (only a couple for our environment) so there isn’t a need to over complicate the install.
        Thanks again for your great work –
        Chris

  • I think there may be a bug in v1.0.1
    Line 107 contains a $OSObject.Refname reference which is never used again. This appears to cause an offset in the Operating Systems tab GUI so that the Full Name field becomes blank and all following fields have values offset by one column in the CSV. Removing $)SObject.Refname, appears to fix this.

    • Hi Phil,
      Great find! You’re completely right, this was not intended to be left there in the Add method for the DataGridView. I’ll update the script on the TechNet Gallery right away, thank you!
      Regards,
      Nickolaj

  • Hi Nickolaj,
    Wow, what a response time…
    The german administrator group called *Administratoren*…
    If you need more informations, let me know it.
    With best regards
    Frank

    • Hi again,
      Thank you! As I expected, take a look at this code:
      if (-not($WindowsPrincipal.IsInRole(“Administrators”))) {
      return $false
      }
      elseif ($WindowsPrincipal.IsInRole(“Administrators”)) {
      return $true
      }
      else {
      return $false
      }
      Since I’ve assumed that the group is called ‘Administrators’, that’s the only allowed value. I’ll change this and upload a new version.
      Once again thank you for pointing it out! I’ll let you know if there’s anything else I need, thanks.
      Regards,
      Nickolaj

      • Frank, would you like to test the code on your system so that we can verify if it works? If so, please send me an email. You’ll find my email under the About page.
        Regards,
        Nickolaj

      • I’ve now fixed this issue and uploaded the latest version to the TechNet Gallery.
        Regards,
        Nickolaj

    • Hi Frank,
      Wow, yeah that doesn’t look right. It must have something to do with the local Administrators group is called something else. Could you please give me the name of it in the German version?
      Thank you for pointing this out!
      Regards,
      Nickolaj

  • Awesome stuff, thanks!
    I did run into two problems so far, the first is the process failing due to the path exceeding more than 260 characters when the process was trying to import the OS installation files. To get around the problem I had to shorten the “Name” of the OS and the “SourcePath” location of the OS files in the OSDATA.CSV file.
    The second problem was the bootstrap.ini file added a “.” to my member server computer name which caused the litetouch.wsf to generate an error trying to connect to my MDT member server as seen in the following screen shots. To get around the issue initially I had to hit F8 to open a command prompt and add my MDT server name with a “.” at the end of the name to the hosts file every time the error came up. This is something I’d suggest you try to fix in the next version.
    Link to Screen Shots on my OneDrive… https://1drv.ms/1xpFj3A
    Thanks again for the great work!
    Regards,
    JJ

    • Hi Jim,
      Thank you for the nice words!
      Yeah, I’m aware of that there’s no check of the maxmimum characters of the imported SourcePaths, I’ll add that to the fix list.
      Regarding the second problem, are you running this on server in a workgroup or domain?
      Regards,
      Nickolaj

  • Great stuff, thank you for sharing. Just wondering what was used to create the GUI?

Sponsors