Clean Up before Sysprep

I use MDT to build the image I deploy with SCCM. When the image have been patched, there is a lot of superseded patches and temp files. With this script “Action-CleanupBeforeSysprep-2_4.wsf” you can remove a lot of the files that are not needed anymore. It is about 1 GB you can compress the image. For Windows 8 + Windows 8.1 + Windows 10, you can skip step 2 to 6. Thanks to Mikael Nystrom blog post for the inspiration.

1. Download “Action-CleanupBeforeSysprep-2_4.wsf” and create an application in MDT
image read more

Display the correct computer name in WinPe using a MDT task sequence

When you have MDT integrated in SCCM and create a MDT task sequence. Then BGinfo is used to display some information during OSD. When the Pc is in WinPe, then it shows a MININT-xxxxx as computer name.


With you can change that so it displays the correct computer name.

Copy the files to the “Tools/x86” folder of your MDT Toolkit files package. You can backup the original BGI files if you want.
Replicate the MDT toolkit Files package. Now it shows the correct computername and DP info during WinPe. read more

Remote control Pc during OSD

In a pervious post I have written about how you can remote control a Pc in WinPe. In this post I will show you how to setup your task sequence to remote control the Pc after the WinPe phase. Thanks to Gery’s blog for the inspiration.

1. Download After you have extracted it, you should have 4 files: SCHook64.dll + vncviewer.exe + winvnc.exe + StartVNC.cmd

2. Start “winvnc.exe” –> set a password. Click “Ok”. When you click “Ok” a .ini file will be generated.

3. Open “ultravnc.ini” and delete the line that starts with “Path=” and save the file. read more

Java deployment with PowerShell App Deployment Toolkit

PowerShell App Deployment toolkit is a very good and free wrapper for software that I deploy with SCCM. I have created a java 8 Update 91 deployment and  you can download it here. The command line for a silent deployment of the application or package in SCCM is:

Deploy-Application.exe -DeplyMode “Silent”
Deploy-Application.ps1 -DeplyMode “Silent”

Do the following to extract the msi files from java installer:

1. Download the java packages here.

2. Start the java installer, but dont click next. read more

Windows installation on “D” drive in a MDT task sequence

If you use a MDT task sequence in SCCM CB 1602, then windows will be installed on the D-drive. To get windows installed on the C-drive, then you should find the step called “Set variable for Drive Letter”


Change the setting from “False” to “True”.  Click “Ok” to save the changes to the task sequence.


I know the in the description is says “Only applicable with ConfigMgr 2012 SP1”. But I have also seen this issue SCCM CB 1602.

Add “cmtrace” during OSD

When I have to look in log files for errors and other things, I always use CMtrace. It is a very good log file viewer. CMtrace is already included in WinPE. But not in windows. So this small .cmd file will add it to windows and then you can use it on all your windows installations.

1. Create a package with “CMTrace.exe” and “copy_cmtrace.cmd”. You can download the here.

2. Create a “Run Command Line” step after WinPE phase in your task sequence with the following settings:

Command line: copy_cmtrace.cmd read more

Enable Windows 7 AERO during OSD

If you want to make sure AERO is enabled in windows 7 after OSD, then you can “Run Command Line” with the following settings at the end of the task sequence.

Command line: winsat dwn –xml results.xml


Enable System Restore during OSD

I use MDT to create the WIM image that I deploy with SCCM. MDT disabled system restore. So I have created this PowerShell script that enabled System restore with the default setting. To enable system restore follow these steps:

1. Download “EnableSystemRestore.ps1” and put it in a SCCM package.

2. Create a ”Run PowerShell Script” step at the end of the task sequence with the following setting. If you sign the script, the you can set the “PowerShell execution policy” to “AllSigned”. read more

Improve deployment time during OSD with power management.

To improve the time that it takes to install a computer with OSD, you can add a “High Performance Power Scheme” while OSD is running. And then changed it back to the default “Balanced” at the end of the task sequence. You have to add the “High Performance Power Scheme” while you are in WinPE and in Windows.

1. Create a package that contains “PowerCfg.exe” for the WinPE phased. You can find the file on a windows PC.

2. Create a “Run Command Line” step when the task sequence is in WinPE. It could be just before you apply the OS image. read more

Post action in Task sequence

If you want to do stuff after you task sequence is finished, then you can use the variable “SMSTSPostAction”. Create a “Set Task Sequence Variable” step in the beginning of the Task sequence. In this example the computer will reboot at the end.

Name: Give it a name. Ex “Set SMSTSPostAction”
Task Sequence Variable: SMSTSPostAction
Value: shutdown /r /t 30