The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…

  • Archives

  • Meta

PowerShell is King – Building a Reference Image Factory (v 3.2)

Posted by Mikael Nystrom on February 23, 2017

The Image Factory has been re-worked and updated. It also has moved to GitHub

Concept and flow

The idea is the same, we use MDT, create refimages task sequences that runs without any questions. A PowerShell script will grab all enabled Task Sequences in a specified folder, create a VM for each of them. Grab the Bios Serial number from each om them, update customsettings ini with that information, start the VM’s (number of concurrent VM’s determine how many VM’s can run at the same time, wait until all VM’s are done and finally removes all VM’s for a cleanup process. You can run the script as is (if you store it in C:\Setup\ImageFactoryV3ForHyper-V on you MDT server), or you can open it in ISE and run section by section to see what happens.

The XML file (C:\Setup\ImageFactoryV3ForHyper-V\ImageFactoryV3.xml)

Is a control file for settings, pretty straightforward, just make sure that all values are correct.


The Script C:\Setup\ImageFactoryV3ForHyper-V\ImageFactoryV3-Build.ps1

The script contains some functions and logic, each section is described so you do know what it does. There are switches to the script,

  • -UpdateBootImage
  • -EnableMDTMonitoring
  • -TestMode

UppdateBoot image $True, updates the bootimage before copy, EnableMDTMonitoring require that MDT monitoring is enabled of the deployment share and testmode is not yet working (I’ll get back on that)


The PSINI Module

One big change is that instead of using a hack, using KVP i switches over to use a module called PSINI, it basically turns customsettings.ini into a hash table, making it easy to configure using PowerShell. That also means you need to download that module from TechNet Gallery all credit for that module goes to

Have Fun


Posted in MDT, PowerShell, Reference Image | Tagged: , , | Leave a Comment »

Nice to Know – Update Rollup 2.1 for System Center 2016 Virtual Machine Manager

Posted by Mikael Nystrom on February 22, 2017

And you should download and install this now. It contains fixes that was caused by Update Rollup 2.0.


Link to KB:

Link to Patches:

Download the Administrator Console update package now

Download the Virtual Machine Manager Server update package now

And Do NOT to forget to update the agents!

Posted in SCVMM, Virtual Machine Manager | Tagged: , | Leave a Comment »

OSD – Conditional disk layout (based on model)

Posted by Mikael Nystrom on February 10, 2017

A while back I did an online training for Penton Tech on Windows 10 OS Deployment. One of the attendees had a question (you know who you are).

– Is it possible to format and partition differently, based on what model I’m deploying?

Yes, you can have different disk layout/partitioning/volumes, based on anything, and that includes the model of the computer. I use this when deploying servers and client to have different partition schemas on virtual machines, I do not need to have the recovery partition in the end of the virtual disk, I don’t really “repair” a Virtual Machine the same way as i recover a physical machine, and you should not.

So, how do you do this?

Open your task sequence and modify the New Computer step like this.

The modified Task Sequence.

In this Task Sequence there are three different group’s, one for virtual machines, one for HP ZBook Studio G3 and the last one for everything else.

The modification starts under Validate, the first step after that sets DiskDone=NO, next step is the Group named Virtual Machine with the following conditions set:

Conditions on the group Virtual Machine.

The the group is executed if the Model is ‘Virtual Machine’ and DiskDone is NOT set to YES, so basically if it is a Virtual Machine it will partition/format according to the steps in the group. In the end of the group it will set DiskDone to YES, that way we know the disks are done and we can use that to prevent the following partitioning steps from running. Let us check the next step:

Conditions on the group HP ZBook Studio G3.

This step is the same as the step for Virtual Machine with one difference, in this case it only runs when the Model is a HP ZBook Studio G3. Let us check the last step:

Conditions on the group All others.

The last groups executes on any device, as long as DiskDone is NOT set to YES.

The Result.

Here is the result when running this in a Virtual Machine:


Here is the result when running this on a HP:


Here is a plain vanilla install:


Have fun!


Posted in Lite Touch, MDT, OS Deployment, OSD | Tagged: , , , | Leave a Comment »

Nice to Know–It is possible to adjust when resynchronization is allowed to happen

Posted by Mikael Nystrom on February 8, 2017

So, Hyper-V replica is cool, but in Windows Server 2016 it became even cooler. It is now possible to configure the timeframe that resynchronization is allowed to happen.

I was wrong, this setting is actually available in Windows Server 2012 R2, just never seen it before, still cool, but not new in Windows Server 2016, sorry.



Posted in Hyper-V, Windows Server 2016 | Tagged: , | Leave a Comment »

Windows 10 Insider – New Fun Feature

Posted by Mikael Nystrom on February 2, 2017

In future releases of Windows 10 (Build 15014 or later), there is a new feature in Hyper-V currently called “Quick Create”

It basically means that you do not need to run trough the entire wizard to create a VM, instead it is a single page, like this:


Have fun.

/The Bunny

Posted in Hyper-V, Insider, Windows 10 | Tagged: , , | Leave a Comment »

OSD – Deploying Windows Server 2016 NANO using Microsoft Deployment Toolkit

Posted by Mikael Nystrom on January 31, 2017

The “Gandalf” of Windows Operating System has done it once again, I’m talking about Michael Niehaus of course. He has created a package for MDT Build 8443 that enables you to deploy NANO Server using MDT, including Domain Join.


Here is the link to the post.

Happy Deployment


Posted in NANO, OS Deployment, OSD, Windows Server 2016 | Tagged: , , , | Leave a Comment »

Event – Mega Geek Week! 5 Days packed with hands-on labs and the industry’s best practice’s

Posted by Mikael Nystrom on December 9, 2016

This my friend is a very rare opportunity, it will most likely never happen again. We are running 3 different Geek Weeks at the same time, at the same location,

Datacenter Geek Week (Building a Datacenter or Private Cloud)

Identity Geek Week (Identity in the Windows platform)

OS Deployment Geek Week (Advanced Operating System Deployment)


During 5 full days, we will start on Sunday, run sessions every day, do quick session after regular training), we all stay at the same hotel, we eat breakfast, lunch and dinner together, it is a FULL week, the entire hotel is just for us, extremely shiny and cool

Read more and sign up for this very unique opportunity.



Posted in Event | Tagged: | 3 Comments »

Event in Stockholm – SMB Summit 2016 (3 Tracks) – In Swedish

Posted by Mikael Nystrom on December 8, 2016


Hej, så är det dags igen, Jag, Peter och Mattias kör en heldag på LabCenter med fokus på Small and Medium Business i nutid och framtid. Under dagen kommer vi att köra 3 olika spår (och du kan hoppa mellan dom som du vill), det blir: Windows Klient, Windows Server och Cloud. Bortsett från all teknik så blir det lite trevlig julmat och eventuellt kommer det att finnas en gran med julklappar. Läs mer här:



Posted in Event | Tagged: | Leave a Comment »

OSD – Add information to the Computer during OSD using a Custom Tattoo Step

Posted by Mikael Nystrom on December 2, 2016

When using an MDT (integrated in ConfigMgr or standalone) there is a step called Tattoo, this step will write information to the registry as well as to the WMI repository.

Let us see what it looks by default:

Get-WMIObject –Class Microsoft_BDD_Info


Get-Item -Path ‘HKLM:\SOFTWARE\Microsoft\Deployment 4’


Cool, but I need my own stuff?

We have done this for various  reasons and many customers, it could be used for making sure the computer ends up in certain ConfigMgr Collections, or that applications behave in a certain way, or that the asset management tools does the job differently, or that the correct support team can know what the computer was configured for, or what task sequence that was used, or…. As you see the are some valid reasons for this, no doubt.

The question is of course, should you modify the existing ZTITatto.wsf and corresponding .MOF file?, No, you should not do that, instead you should create new files and use them instead.

So, here is the download :

To make the work in a task sequence you need to add the files to you Scripts folder, update the CustomSettings.ini if you are using Custom Properties and add a step in the Task Sequence.

Here is a sample of CustomSettings.ini


I have added 4 new properties, added them to a MacAddress, so first step is to verify that the ZTIGather process reads this correct, let us verify this by running:

cscript \\redepl01\mdtproduction$\Scripts\ZTIGather.wsf /inifile:c:\Temp\CustomSettings.ini

Result after running the following command to perform the inventory.

Now, lets run the custom tattoo script:

cscript \\redepl01\mdtproduction$\Scripts\ViaMonstraTatoo.wsf

That looks great!

Now, let us verify that we get the correct data from WMI and Registry:

First, get the WMI repository:

Get-WmiObject -Class ViaMonstra_Info

The WMI repository was updated.

Let us check the Registry:

Get-Item -Path ‘HKLM:\SOFTWARE\ViaMonstra\OSD’

The Registry was updated.

At LabCenter

The Customer LabCenter deploys computer for hands-on labs and they wanted each computer to be tattooed with information regarding the LAB and one thing they use it for is to be able to display the information directly in the screen using BGinfo, but they also use it for other purposes. BGInfo reads the Registry values, or WMI


How to change my own stuff then?

Download the files from: and edit the scripts, (.wsf and .mof) by replacing the values that are in use, like

  • ViaMonstra
  • ViaRole
  • ViaClass
  • ViaOwner
  • ViaTag

Save, and verify


Posted in ConfigMgr, Lite Touch, MDT, OSD, Zero Touch | Tagged: , , , , | 5 Comments »

Nice to Know – The Deployment Bunny is now on GitHub

Posted by Mikael Nystrom on November 25, 2016

I have been on GitHub for a while, but lately I have started to move everything I do to GitHub, for various reasons. One is that is easier for you to get the files directly, another is that I get source control. But there are many more reasons for this. There are many different repositories, the two main repositories are Functions and The Bunny Files and when I do demo script they will usually end up in the Demo Script folder.

The Bunny at GitHub.

Can I “Steal” your script?

Yes, you can, but it would be nice to get cred for the work, so include the link to the blog or to the GitHub repository. However, I don’t like to see my scripts ending up in PowerShell Gallery or the TechNet Gallery without asking me first…

How can I use the scripts directly from my scripts?

That is easy, you do something like this:

Invoke-WebRequest "" -OutFile ~/EnableNestedHyperV.ps1
Import-Module ~/EnableNestedHyperV.ps1
Enable-NestedHyperV -VMname TEST100

How will this affect the future?

This basically means that everything I do will end up at GitHub first and later most of this will then have a related blogpost, but not all, and not the same day.


Posted in GitHub, PowerShell | Tagged: , | 5 Comments »