The Deployment Bunny

OS Deployment, Virtualization, Microsoft based Infrastructure…


    Mikael Nystrom

    Mikael Nystrom

    OS Deployment Geek, Virtualization and System Center

    Mikael Nystrom is a Microsoft MVP and Principal Architect at TrueSec

  • Archives

  • Meta

Archive for the ‘MDT’ Category

Nice to Know – Reset the WSUS update Count during OSD, allows automatic reinstallation of patches that failed

Posted by Mikael Nystrom on March 30, 2015

No, this is NOT something new, its just that it needs to be spread more…

In MDT 2010, there were some improvements to the ZTIWindowsUpdate.wsf script, the reason as to cut down time, they did and at the same time ZTI was not as reliable as it used to be. The issue is very simple, the task sequence remembers all patches that has been installed, so it will never ever re-install a patch and that is great, unless a patch needs to be reinstalled and it might need to…

Alexey (with help from Keith) did create a script in mars 2010 that resets the counter. You can find the blog post here The script you download from my site, does the same thing, the script is just slightly polished…

How to use it?

  • Download, Unzip and store the script in the Scripts folder of the MDT share
  • Modify the task Sequence:
  • Add a “Run Command Line” with the following command
    • cscript.exe "%SCRIPTROOT%\ZTIWindowsUpdateReset.wsf"

It should look something like this:



Posted in MDT | Tagged: | Leave a Comment »

Nice to Know – Reset WSUS to “Factory Default” settings after OSD in MDT

Posted by Mikael Nystrom on March 30, 2015

Same days a go I write a post on how to reset WSUS after OSD in MDT, but of course a very good friend was complaining slightly, it was something “Yeah, great but I would like to reset WSUS back to it has never ever been used, like a factory reset…”

Since I’m a nice guy, here it is, the WSUS Factory Reset application for MDT.

So, same story, download(, unzip and import as an application, like this.


Then add it as an application in the MDT Task Sequence, something like this.



Posted in MDT | Tagged: | 2 Comments »

Nice to Know – Reset WSUS settings after OSD in MDT

Posted by Mikael Nystrom on March 26, 2015

After deploying a OS in MDT there are some “leftovers”, this script will remove those settings which is very convenient when creating a ref image that uses another WSUS server and you would like to minimize issues. Just download it, unzip it, import as an application, like this.


Then add it as an application in the MDT Task Sequence, something like this.

Download :



Posted in MDT | Tagged: | 2 Comments »

OSD – Install IE 11 in the ref image like a pro using a PowerShell wrapper

Posted by Mikael Nystrom on January 27, 2015

One of the best ways to get ready for Windows 10 is to deploy Internet Explorer 11 in your current environment, if you can make IE 11 work there is a huge chance that you will have no or just a few issues when Windows 10 is about to be deployed.

The best way to do that is to add IE 11 to the reference image when you are replacing, refreshing or perform a bare-metal deployment and the next best thing is to deploy it using any software distribution engine, like WSUS, ConfigMgr, Intune or something like that.

Even if you distribute it as a software, you should still update your reference image and here it is.

Step No:1 – Download IEAK

The best way to deal with IE11 is to create a configuration only package for all Windows versions that already have IE11 installed (Like Windows 8.1 or Windows Server 2012 R2) and create a full install package for all the other versions of Windows you are using in your organization and that is done by Internet Explorer Administration Kit (IEAK), just download it from and install on a computer WITH IE11 already installed.

Step No:2 – Create all packages

Start IEAK and create all your packages for each version and each language of IE you would like to have

  • Windows 7 SP1 x86/x64
  • Windows 8.1 x86/x64

(Create both full install package as well as as configuration packages)

Step No:3 – Download the PowerShell script

After creating all the packages, with the customized settings you will have a folder structure with full packages as well as configuration only for one or more language and instead of creating one application for each of these packages you can create one application in the deployment workbench that will figure out which package that should be installed.

  1. Download the PowerShell script from
  2. UnZip it and browse to the folder “Install – Internet Explorer 11\Sorurce”
  3. Copy the content of you “build” folder that was created when using IEAK into the folder named “Source”, it should contain folder names like “BrndOnly”,”FLAT” and “Ins”

This is the tree structure after copying the files.

Step No:4 – Create the Application in the Deployment Workbench

No you need to create the application, follow these steps and you are done.

  1. Open Deployment Workbench and browse to the Application node
  2. Create a new application named “Install Internet Explorer 11” with the Command Line “PowerShell.exe -ExecutionPolicy ByPass -File Install-InternetExplorer11.ps1”

The properties of the “Install – Internet Explorer 11” application in the Deployment Workbench.

Step No:5 – Add the application to the Task Sequence

Open your task sequence and add the application to the task sequence.

Install Internet Explorer 11 is added to the Task Sequence.

Happy OSD


Posted in Internet Explorer, MDT, OS Deployment, OSD | Tagged: , , | 1 Comment »

Nice to Know – Yes, it is possible to copy items between to Task Sequences as well as copy items between 2 different deployment shares

Posted by Mikael Nystrom on November 11, 2014

This is NOT a new feature, I cant even remember how long this has been working, but this morning I saw a Tweet when someone was happy about the possibility to copy items between deployment shares in MDT, so for thoose that knows all this, you do not need to read more, for the rest of you.

Yes, you can copy items between Task Sequences

(it also works copy items within a Task Sequence)

This works in both MDT as well as in ConfigMgr.




Yes, you can copy items between Deployment Shares (Only for MDT, Lite Touch)

In this case I have 3 deployment shares in the Deployment Workbench and it is possible to copy all kind of items between these 3 deployment shares


Let us copy some application from one deployment share to another.

Select Application, right click and select Copy.


Browse to new location, right-click, select Paste.


The application has been copied to the new deployment share.



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

OSD – Using PowerShell Commands in UserExit VB script to extend the ZTIGather process during OSD

Posted by Mikael Nystrom on November 11, 2014

During todays session I realized that I have done a lot of OSD stuff, but never published it (shame on me), so time to work. First up is how to run PowerShell CommandLets inside a UserExit script. A UserExit script is an extension to the ZTIGather process, giving you the opportunity to extend the gather process with information that the Gather process does not cover. That has been possible for a long time, but VBscript is not really the easiest script language in the world, so I asked my self if it would be possible to use PowerShell inside the VBscript and of course it is!

The idea

The basic idea is to run the UserExit script from customsettings.ini as usual and then do a jump out into PowerShell, execute the PowerShell CMDLets, terminate and return the value into the VBscript, which then will be a value connected to a Custom Property in the gather process, which then can be consumed by customsettings.ini and/or the task sequence. you can download everything from here:


The Boot Image

The boot image must have support for PowerShell and you can get that by adding .NET and PowerShell

Lite Touch.

Zero Touch.

The Customsettings.ini file

The customsettings.ini file will direct ZTIGather to process the section called UserExits, which will execute the UserExit.vbs script, call the function called RunningPSCommand and return the value from that function into the property called PSCommand.

This is a sample of how the customsettings.ini file should look like to call the UserExit script.

The UserExit Script that runs PowerShell commands

The script is rather simple, basically the PowerShell command is a string, executed by PowerShell.exe and using Executor.StdIn.Close to close the window and then using Executor.StdOut.ReadAll to grab whatever you have in the window and put that in the RunningPSCommand, which then is returned back to the ZTIGather process as a value for the Property RunningPSCommand.


The result of running the ZTIGather


As you can see the PowerShell command was running and returned the value “Virtual Machine” and now the Property PSCommand is equal to Virtual Machine and can be used elsewhere in CustomSettings.ini or in the Task Sequence


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

OSD – Static IP Address does not work in Lite Touch using Offline Media

Posted by Mikael Nystrom on November 7, 2014

During a project Johan and was working a while ago, we used Offline Media and we had a problem to set a static IP Address during OSD. After digging Johan found the issue and here is the solution.



Posted in MDT, OSD | Tagged: , , , | 1 Comment »

PowerShell is King – Testing OS Deployment Web Services using PowerShell

Posted by Mikael Nystrom on November 2, 2014

Recently I was setting up Maik Kosters OS Deployment Web Services for a customer and I need to test them, sure, you can do that interactively directly by running them, but I wanted the “PowerShell” way to do it.

You can get the Web Services from Maik Koster here:

Testing a Web Services the Non PowerShell Way.

Browsing to the Web Services

Select the DoesComputerExists

Type in a value and Invoke.

Testing a Web Services the PowerShell Way.

Since PowerShell has the function built-in it is very much a no-brainer.

To connect and get all members from the Web Services execute this:

$ADWebS = New-WebServiceProxy -Uri http://MDT01/OSD/ad.asmx?WSDL
$ADWebS | Get-Member -Type Method

That will give you something like this back


To connect and get one member with some detail execute this:

$ADWebS = New-WebServiceProxy -Uri http://MDT01/OSD/ad.asmx?WSDL
$ADWebS | Get-Member -Name DoesComputerExist -Type Method | Format-List

That will give you something like this back


So, to test the DoesComputerExists with a value you can now execute the following:

$CompuerNameToTest = "MDT01"
$ADWebS = New-WebServiceProxy -Uri http://MDT01/OSD/ad.asmx?WSDL
$ComputerExistsInAd = $ADWebS.DoesComputerExist("$CompuerNameToTest")

Write-Host "The Computer $CompuerNameToTest exists in Active Directory: $ComputerExistsInAd"

So if the Computer Exists in Active Directory you should get something like this back



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

Nice to have–VB Script Wrapper for all VC++ installers to be used in MDT

Posted by Mikael Nystrom on September 25, 2014

During todays session at The Ultimate Event I did a demo of a VBscript Wrapper that install all VC++ runtimes. Mr “Someone” asked if it was published and I said yes, I was wrong so here it is.

The Script

The script will install all versions of VC++ on 32 and 64 bit machines as an application in a task sequence, that way you don’t need to have one application for each VC++ application.

Download the script from here

The Task Sequence

After you have added the application in the MDT workbench, add the application to the Workbench like this:


The Application

When importing the application it should look like this:


The folder

The folder needs to have all the VC++ files organized in a folder structure that looks like this:


You can use the script in the following folder to download all files in the correct folder structure. Check this blog post:


Posted in MDT | Tagged: | 6 Comments »

PowerShell is King – Bulk import applications I MDT

Posted by Mikael Nystrom on September 3, 2014

Often I need to import applications into the Deployment workbench and that is fine. The process is easy and fast, but it is boring and if you have more then 5 apps it is really boring. Based on the fact that almost all my apps in MDT is deployed using VB or PowerShell wrappers its is just one file in a folder and then there is a subfolder with the content. You don’t need to be a genius to figure out that 90% of all the apps pretty much have the same folder and file structure in the root of the application folder, so why don’t we use PowerShell to import all the apps based on some guessing?

The Logic:

This parts can be modified, edit, or you can add your own. Basically it reads the from the folder structure you specify and the script will then scan the folder structure for folders, assuming that every folder is an application. If it finds .msi, .msu, exe, .bat, .wsf, or .ps1 files it will then import them as applications. The important thing is that it will import the first “hit”. That means that you should store the real setup files in a subfolder, I usually use .\Source as the source folder. Here you can see the .WSF part logic

Part of the script.

The command line:

This is the tricky part, since there is no way to know that it will be a guessing game and the command line might need to be modified after import, but I rather modify 2-3 applications instead of importing all of them manually.

The default cmdline for all imported apps will be:

.EXE "$Install /q"
.MSI "msiexec.exe /i $Install /qn"
.MSU "wusa.exe $Install /Quiet /NoRestart"
.PS1 "PowerShell.exe -ExecutionPolicy ByPass -File $Install"
.WSF "cscript.exe $Install"

The Script:

The script is rather easy, it takes 2 parameters. The folder from where to import and the deployment share. You need to have MDT installed since it is using PowerShell cmdlets from MDT. The syntax for the script looks like this:

.\Import-MDTApps.ps1 -ImportFolder C:\Script\AppFolder -MDTFolder C:\MDTBuildLab

you could also add –Verbose if you like lots of text on the screen.

Output when using –Verbose during import.

You can download the script here:


Posted in Deployment, MDT | Tagged: | 3 Comments »


Get every new post delivered to your Inbox.

Join 4,785 other followers