{"id":1351,"date":"2019-06-24T13:07:15","date_gmt":"2019-06-24T12:07:15","guid":{"rendered":"https:\/\/hypervlab.co.uk\/?p=1351"},"modified":"2019-07-30T09:22:04","modified_gmt":"2019-07-30T08:22:04","slug":"customising-reference-task-sequence","status":"publish","type":"post","link":"https:\/\/hypervlab.co.uk\/?p=1351","title":{"rendered":"Customising Reference Task Sequence"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\"> 6<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>\n<p>In this blog post i will cover how to get the best performance out of your Reference Task Sequence and some useful Applications which are also worth adding to your deployment share to improve build times, patching and cleans. <\/p>\n\n\n\n<p>Default Task Sequence &#8211; Untouched<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"650\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-240.png\" alt=\"\" class=\"wp-image-1370\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-240.png 721w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-240-300x270.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-240-640x577.png 640w\" sizes=\"auto, (max-width: 721px) 100vw, 721px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"> <strong>Improving Performance<\/strong> <\/h3>\n\n\n\n<p>What I&#8217;ve found over the years of Building and Deploying through MDT, is that by default the power plan set on the device is always balanced, which is fine for general day to day use however when your wanting to get an image deployed as soon as possible and maximise all the CPU Cores on the processor. it does actually save time in deployment and image capture. So we negate this small problem we can create a &#8216;Run Command Line&#8217; Module with a CMD line of :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PowerCfg.exe \/s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c<\/code><\/pre>\n\n\n\n<p>The Actual &#8216;Run Command Line&#8217; Module would look like this<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"650\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-241.png\" alt=\"\" class=\"wp-image-1398\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-241.png 721w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-241-300x270.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-241-640x577.png 640w\" sizes=\"auto, (max-width: 721px) 100vw, 721px\" \/><\/figure><\/div>\n\n\n\n<p>Where to add the Power Plan Module? I normally add it under <br>1) &#8216;<strong>Initialization Folder<\/strong>&#8216; after the &#8216;Gather local only&#8217;<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"244\" height=\"52\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-242.png\" alt=\"\" class=\"wp-image-1372\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-242.png 244w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-242-238x52.png 238w\" sizes=\"auto, (max-width: 244px) 100vw, 244px\" \/><\/figure><\/div>\n\n\n\n<p>2) &#8216;<strong>State Restore&#8217; <\/strong>after the &#8216;Gather local only&#8217; <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"240\" height=\"56\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-243.png\" alt=\"\" class=\"wp-image-1373\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-243.png 240w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-243-238x56.png 238w\" sizes=\"auto, (max-width: 240px) 100vw, 240px\" \/><\/figure><\/div>\n\n\n\n<p>3) &#8216;<strong>Imaging<\/strong>&#8216; &gt; &#8216;<strong>Capture Image<\/strong>&#8216; &gt; &#8216;after the reboot option&#8217;<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"240\" height=\"197\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-244.png\" alt=\"\" class=\"wp-image-1374\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Installing Visual Studio Runtimes (VC++)<\/strong> <\/h3>\n\n\n\n<p><br>Mikael Nystrom (TrueSec Deployment Guru) created a blog post back in 2014 (<a rel=\"noreferrer noopener\" aria-label=\"Link Here (opens in a new tab)\" href=\"https:\/\/deploymentbunny.com\/2014\/09\/25\/nice-to-havevb-script-wrapper-for-all-vc-installers-to-be-used-in-mdt\/\" target=\"_blank\">Link Here<\/a>) Which allowed for the latest visual studio run times to be installed into a reference image from a single VBSScript. To save time and automate the process I&#8217;ve create a PowerShell Script which will download the VC++ Setup files and import them directly into the MDT Reference Share.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Create Application - Action-VisualStudioRuntime\n# Script Created by Mikael Nystrom \n# Source : https:\/\/deploymentbunny.com\/2014\/09\/25\/nice-to-havevb-script-wrapper-for-all-vc-installers-to-be-used-in-mdt\/\n# Steps  C:\\Setup\\Files\\Tools\\Get-AllC++Runtimes\\Get-Downloads.ps1 -DownloadFile C:\\Setup\\Files\\Tools\\Get-AllC++Runtimes\\download.xml -DownloadFolder 'C:\\Setup\\DL'\n\n# Import PowerShell Modules\nImport-Module \"C:\\Program Files\\Microsoft Deployment Toolkit\\bin\\MicrosoftDeploymentToolkit.psd1\"\nImport-Module BitsTransfer\n\n# Clear Screen\nClear-Host\n\n$MDTReferenceShare = Read-Host 'Please Enter Reference Share ROOT Location (D:\\ReferenceShare)'\n$TmpDownload = 'C:\\MDTDownload'\nIf (!(Test-Path $TmpDownload)) {\n    New-Item -ItemType 'Directory' -Path $TmpDownload | Out-Null\n    Write-Output 'Temporary Download Folder Created: C:\\MDTDownload'\n\n    # Download Visual Studio Setup Files\n    Invoke-WebRequest -Uri https:\/\/raw.githubusercontent.com\/DeploymentBunny\/Files\/master\/Tools\/Get-AllC%2B%2BRuntimes\/Get-Downloads.ps1 -OutFile $TmpDownload\\Get-Downloads.ps1\n    Invoke-WebRequest -Uri https:\/\/raw.githubusercontent.com\/DeploymentBunny\/Files\/master\/Tools\/Get-AllC%2B%2BRuntimes\/download.xml -OutFile $TmpDownload\\download.xml\n    Invoke-Expression -Command \"$TmpDownload\\Get-Downloads.ps1 -DownloadFile $TmpDownload\\download.xml $TmpDownload\\Sources\"\n    Write-Output `r 'Visual Studio Runtime Setup Files Downloaded' `r\n}\n\n# Import Visual Studio Application\nNew-PSDrive -Name \"DS001\" -PSProvider MDTProvider -Root \"$MDTReferenceShare\" | Out-Null\nInvoke-WebRequest -Uri https:\/\/github.com\/DeploymentBunny\/Files\/blob\/master\/Tools\/Install-X86-X64-C%2B%2B\/Install-MicrosoftVisualC%2B%2Bx86x64.wsf  -OutFile $TmpDownload\\Install-VisualStudioRuntimes.wsf -Verbose\nimport-MDTApplication -path \"DS001:\\Applications\" -enable \"True\" -Name \"DeploymentBunny - Visual Studio ++\" -ShortName \"VisualStudio++\" -Version \"\" -Publisher \"Mikael Nystrom (DeploymentBunny)\" -Language \"\" -CommandLine \"cscript.exe Action-Install-VisualStudioRuntimes.wsf\" -WorkingDirectory \".\\Applications\\DeploymentBunny - Visual Studio\" -ApplicationSourcePath \"$TmpDownload\" -DestinationFolder \"DeploymentBunny - Visual Studio\" -Verbose\nWrite-Output `r 'MDT Application Import Complete' `r\nRemove-Item $TmpDownload -Force -Recurse -Verbose ; Remove-PSDrive 'DS001'<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1211\" height=\"672\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/VC_MDTImport.gif\" alt=\"\" class=\"wp-image-1380\"\/><\/figure>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"169\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-245-1024x169.png\" alt=\"\" class=\"wp-image-1376\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-245-1024x169.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-245-300x50.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-245-768x127.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-245-640x106.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-245-1280x211.png 1280w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-245.png 1362w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>The Visual Studio Runtime Script can be added in at any stage on the &#8216;<strong>State Restore<\/strong>&#8216; &#8211; Personally i usually root folder before the Windows Update Tasks called &#8216;<strong>Pre-WU Tasks<\/strong>&#8216; then a Sub Folder call &#8216;Core Applications&#8217; and add the VC++ and Latest .Net Frameworks and Microsoft Silverlight. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"243\" height=\"229\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-248.png\" alt=\"\" class=\"wp-image-1384\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><span style=\"text-decoration: underline;\">De-Bloating Windows 10<\/span><\/strong><\/h3>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"465\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-249.png\" alt=\"\" class=\"wp-image-1386\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-249.png 932w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-249-300x150.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-249-768x383.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-249-640x319.png 640w\" sizes=\"auto, (max-width: 932px) 100vw, 932px\" \/><\/figure><\/div>\n\n\n\n<p>GitHub User: <a rel=\"noreferrer noopener\" aria-label=\"Sycnex (opens in a new tab)\" href=\"https:\/\/github.com\/Sycnex\/Windows10Debloater\" target=\"_blank\">Sycnex<\/a> has created a set of PowerShell Scripts to help with removing the default Windows 10 Metro\/Modern Applications which come pre-installed with the VL Media direct from Microsoft.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"983\" height=\"205\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-250.png\" alt=\"\" class=\"wp-image-1387\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-250.png 983w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-250-300x63.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-250-768x160.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-250-640x133.png 640w\" sizes=\"auto, (max-width: 983px) 100vw, 983px\" \/><\/figure><\/div>\n\n\n\n<p>The script we are going to be looking into for this blog post will be the &#8216;<a rel=\"noreferrer noopener\" aria-label=\"Windows10SysPrepDebloater.ps1 (opens in a new tab)\" href=\"https:\/\/github.com\/Sycnex\/Windows10Debloater\/blob\/master\/Windows10SysPrepDebloater.ps1\" target=\"_blank\">Windows10SysPrepDebloater.ps1<\/a>&#8216;  Using the below code we can download the latest Windows10SysprepDebloater.ps1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Download Windows10Debloter Script\n# Source : https:\/\/github.com\/Sycnex\/Windows10Debloater\n\n# Clear Screen\nClear-Host\n\n# Define Variables\n$MDTReferenceShare = Read-Host 'Please Enter Reference Share ROOT Location (D:\\ReferenceShare)'\n\n# Download PowerShell Script\nInvoke-WebRequest -Uri https:\/\/raw.githubusercontent.com\/Sycnex\/Windows10Debloater\/master\/Windows10SysPrepDebloater.ps1 -OutFile $MDTReferenceShare\\Scripts\\Windows10SysPrepDebloater.ps1\nWrite-Output 'Windows10SysPrepDebloater Downloaded'<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1211\" height=\"672\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/Windows10SysPrepDebloater_Download.gif\" alt=\"\" class=\"wp-image-1388\"\/><\/figure>\n\n\n\n<p><strong>Editing the Windows10SysPrepDebloater Script<\/strong><br>From File Explorer navigate to the location of the script. (D:\\ReferenceShare\\Scripts\\Windows10SysPrepDebloater.ps1) <br>Open the Script using the PowerShell ISE<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"205\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-252-1024x205.png\" alt=\"\" class=\"wp-image-1392\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-252-1024x205.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-252-300x60.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-252-768x154.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-252-640x128.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-252-1280x257.png 1280w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-252.png 1291w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p>The Out of the Box Default &#8216;White-listed (Applications to be kept) are:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'Microsoft.ScreenSketch|Microsoft.Paint3D|Microsoft.WindowsCalculator|Microsoft.WindowsStore|Microsoft.Windows.Photos|CanonicalGroupLimited.UbuntuonWindows|  Microsoft.MicrosoftStickyNotes|Microsoft.MSPaint|Microsoft.WindowsCamera|.NET|Framework|Microsoft.HEIFImageExtension|Microsoft.ScreenSketch|Microsoft.StorePurchaseApp|    Microsoft.VP9VideoExtensions|Microsoft.WebMediaExtensions|Microsoft.WebpImageExtension|Microsoft.DesktopAppInstaller'<\/code><\/pre>\n\n\n\n<p>You can edit the above White-list with the AppxPackage ID&#8217;s from the list below &#8211; Remember adding the below to the white-list will keep them in the Reference Image.<\/p>\n\n\n\n<p><strong>Windows 10 1809 AppxPackage List <\/strong><\/p>\n\n\n\n<p>Microsoft.AAD.BrokerPlugin<br> Microsoft.Windows.CloudExperienceHost<br> Microsoft.Windows.ShellExperienceHost<br> windows.immersivecontrolpanel<br> Microsoft.Windows.Cortana<br> Microsoft.MicrosoftEdge<br> Microsoft.Windows.ContentDeliveryManager<br> Microsoft.NET.Native.Runtime.1.7<br> Microsoft.NET.Native.Runtime.1.7<br> Windows.PrintDialog<br> Microsoft.XboxGameCallableUI<br> Microsoft.Windows.SecureAssessmentBrowser<br> Windows.CBSPreview<br> Microsoft.Windows.XGpuEjectDialog<br> Microsoft.Windows.SecHealthUI<br> Microsoft.Windows.PinningConfirmationDialog<br> Microsoft.Windows.PeopleExperienceHost<br> Microsoft.Windows.ParentalControls<br> Microsoft.Windows.OOBENetworkConnectionFlow<br> Microsoft.Windows.OOBENetworkCaptivePortal<br> Microsoft.PPIProjection<br> Microsoft.Windows.Apprep.ChxApp<br> Microsoft.Windows.CapturePicker<br> Microsoft.Windows.NarratorQuickStart<br> Microsoft.Win32WebViewHost<br> Microsoft.LockApp<br> Microsoft.AsyncTextService<br> InputApp<br> Microsoft.AccountsControl<br> Microsoft.Windows.AssignedAccessLockApp<br> Microsoft.ECApp<br> Microsoft.CredDialogHost<br> Microsoft.BioEnrollment<br> Microsoft.Wallet<br> Microsoft.WebpImageExtension<br> Microsoft.Xbox.TCUI<br> Microsoft.UI.Xaml.2.0<br> Microsoft.UI.Xaml.2.0<br> Microsoft.XboxSpeechToTextOverlay<br> Microsoft.MixedReality.Portal<br> Microsoft.Advertising.Xaml<br> Microsoft.Advertising.Xaml<br> Microsoft.Services.Store.Engagement<br> Microsoft.Services.Store.Engagement<br> Microsoft.StorePurchaseApp<br> Microsoft.BingWeather<br> Microsoft.MicrosoftEdgeDevToolsClient<br> Microsoft.NET.Native.Framework.1.7<br> Microsoft.NET.Native.Framework.1.7<br> Microsoft.VCLibs.140.00<br> Microsoft.VCLibs.140.00<br> Microsoft.GetHelp<br> Microsoft.NET.Native.Runtime.2.2<br> Microsoft.NET.Native.Runtime.2.2<br> Microsoft.NET.Native.Framework.2.2<br> Microsoft.NET.Native.Framework.2.2<br> Microsoft.Microsoft3DViewer<br> Microsoft.MSPaint<br> Microsoft.WindowsMaps<br> Microsoft.WindowsSoundRecorder<br> Microsoft.HEIFImageExtension<br> Microsoft.ZuneMusic<br> Microsoft.ScreenSketch<br> Microsoft.People<br> Microsoft.WindowsAlarms<br> Microsoft.MicrosoftOfficeHub<br> Microsoft.WindowsFeedbackHub<br> Microsoft.Print3D<br> Microsoft.ZuneVideo<br> Microsoft.WebMediaExtensions<br> Microsoft.WindowsCamera<br> Microsoft.MicrosoftSolitaireCollection<br> Microsoft.VCLibs.140.00.UWPDesktop<br> Microsoft.VCLibs.140.00.UWPDesktop<br> Microsoft.XboxGamingOverlay<br> Microsoft.VP9VideoExtensions<br> Microsoft.DesktopAppInstaller<br> Microsoft.Office.OneNote<br> Microsoft.Getstarted<br> microsoft.windowscommunicationsapps<br> Microsoft.WindowsStore<br> Microsoft.XboxApp<br> Microsoft.OneConnect<br> Microsoft.Windows.Photos<br> Microsoft.XboxGameOverlay<br> Microsoft.UI.Xaml.2.1<br> Microsoft.UI.Xaml.2.1<br> Microsoft.YourPhone<br> Microsoft.WindowsCalculator<br> Microsoft.Messaging<br> Microsoft.SkypeApp<br> Microsoft.MicrosoftStickyNotes<br> Microsoft.XboxIdentityProvider<\/p>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Adding Windows10SysPrepDebloater into the Reference Task Sequence<\/span><\/strong><\/p>\n\n\n\n<p>This Script again can do anywhere within the &#8216;<strong>State Restore<\/strong>&#8216;. Personally, I prefer to add the script before the Windows Update Modules run. As the De-bloater script will disable the store updates for the modern apps which have been removed. to add the Script into the Task Sequence we can use a &#8216;Run PowerShell Script&#8217; Module and add the following into it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>%SCRIPTROOT%\\Windows10SysPrepDebloater.ps1<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"650\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-251.png\" alt=\"\" class=\"wp-image-1390\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-251.png 721w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-251-300x270.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-251-640x577.png 640w\" sizes=\"auto, (max-width: 721px) 100vw, 721px\" \/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"> <strong>Deploying CleanupBeforeSysprep Script<\/strong><\/h3>\n\n\n\n<p>Another Script from Mikael Nystrom (TrueSec Deployment Guru) this script is to be run at the end of the deployment task just before the Sysprep Process runs. This resets various windows features and runs a disk cleanup over. Below is the simple PowerShell Import Script I&#8217;ve created to help save time. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Create Application - Action-CleanupBeforeSysprep\n# Script Created by Mikael Nystrom \n# Source : https:\/\/deploymentbunny.com\/2014\/06\/05\/nice-to-know-get-rid-of-all-junk-before-sysprep-and-capture-when-creating-a-reference-image-in-mdt\/\n# Steps  : Download and  Import Action-CleanupBeforeSysprep\n\n# Import PowerShell Modules\nImport-Module \"C:\\Program Files\\Microsoft Deployment Toolkit\\bin\\MicrosoftDeploymentToolkit.psd1\"\nImport-Module BitsTransfer\n\n# Clear Screen\nClear-Host\n$MDTReferenceShare = Read-Host 'Please Enter Reference Share ROOT Location (D:\\ReferenceShare)'\n$TmpDownload = 'C:\\MDTDownload'\nIf (!(Test-Path $TmpDownload)) {\n    New-Item -ItemType 'Directory' -Path $TmpDownload | Out-Null\n    Write-Output 'Temporary Download Folder Created: C:\\MDTDownload'\n\n    # Download Action-CleanupBeforeSysprep\n    Invoke-WebRequest -Uri https:\/\/github.com\/DeploymentBunny\/Files\/blob\/master\/Tools\/Action-CleanupBeforeSysprep\/Action-CleanupBeforeSysprep.wsf  -OutFile $TmpDownload\\Action-CleanupBeforeSysprep.wsf -Verbose\n    Write-Output `r 'Action-CleanupBeforeSysprep.wsf Downloaded' `r\n}\n\n# Import Cleanup Before Sstem\nNew-PSDrive -Name \"DS001\" -PSProvider MDTProvider -Root \"$MDTReferenceShare\" | Out-Null\nimport-MDTApplication -path \"DS001:\\Applications\" -enable \"True\" -Name \"DeploymentBunny - CleanupBeforeSysprep\" -ShortName \"CleanupBeforeSysprep\" -Version \"\" -Publisher \"Mikael Nystrom (DeploymentBunny)\" -Language \"\" -CommandLine \"cscript.exe Action-CleanupBeforeSysprep.wsf\" -WorkingDirectory \".\\Applications\\DeploymentBunny - CleanupBeforeSysprep\" -ApplicationSourcePath \"$TmpDownload\" -DestinationFolder \"DeploymentBunny - CleanupBeforeSysprep\" -Verbose\nWrite-Output `r 'MDT Application Import Complete' `r\nRemove-Item $TmpDownload -Force -Recurse -Verbose ; Remove-PSDrive 'DS001'<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/CleanupBeforeSysprep_MDTImport.gif\" alt=\"\" class=\"wp-image-1378\"\/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"168\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-246-1024x168.png\" alt=\"\" class=\"wp-image-1382\" srcset=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-246-1024x168.png 1024w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-246-300x49.png 300w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-246-768x126.png 768w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-246-640x105.png 640w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-246-1280x211.png 1280w, https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-246.png 1362w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Adding CleanupBeforeSysprep into the Reference Task Sequence<\/span><\/strong><\/p>\n\n\n\n<p>Mikael Recommends that you complete a Reboot of the Operating System before running this script to ensure that there are no pending reboots, or update processes running. Depending on the specs of the Virtual Machine this is running on, I&#8217;ve seen this take up to 2 Hours, this is mainly on the Disk Cleanup and Windows Update Patch cleanups.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"222\" height=\"137\" src=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/image-247.png\" alt=\"\" class=\"wp-image-1383\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><span style=\"text-decoration: underline;\">Useful Blog Posts on Creating Reference Builds<\/span><\/strong><\/h3>\n\n\n\n<p><a rel=\"noreferrer noopener\" aria-label=\"  Mikael Nystrom - Twitter (opens in a new tab)\" href=\"https:\/\/twitter.com\/mikael_nystrom\" target=\"_blank\">  Mikael Nystrom &#8211; Twitter<\/a><br>  <a rel=\"noreferrer noopener\" aria-label=\"Johan Ardwick - Twitter (opens in a new tab)\" href=\"https:\/\/twitter.com\/jarwidmark\" target=\"_blank\">Johan Ardwick &#8211; Twitter<\/a><br>  <a rel=\"noreferrer noopener\" aria-label=\"Michael Niehaus - Twitter (opens in a new tab)\" href=\"https:\/\/twitter.com\/mniehaus\" target=\"_blank\">Michael Niehaus &#8211; Twitter<\/a><br>  <a rel=\"noreferrer noopener\" aria-label=\"Official Microsoft TechNet Reference Build Guide (opens in a new tab)\" href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/deployment\/deploy-windows-mdt\/create-a-windows-10-reference-image\" target=\"_blank\">Official Microsoft TechNet Reference Build Guide<\/a><br>  <a rel=\"noreferrer noopener\" aria-label=\"DeploymentResearch - Building 1809 Reference Image (opens in a new tab)\" href=\"https:\/\/deploymentresearch.com\/Research\/Post\/1676\/Building-a-Windows-10-v1809-reference-image-using-Microsoft-Deployment-Toolkit-MDT\" target=\"_blank\">DeploymentResearch &#8211; Building 1809 Reference Image<\/a><br>  <a rel=\"noreferrer noopener\" aria-label=\"DeploymentBunny - Visual Studio Run Time (VC++) (opens in a new tab)\" href=\"https:\/\/deploymentbunny.com\/2014\/09\/25\/nice-to-havevb-script-wrapper-for-all-vc-installers-to-be-used-in-mdt\/\" target=\"_blank\">DeploymentBunny &#8211; Visual Studio Run Time (VC++)<\/a><br>  <a rel=\"noreferrer noopener\" aria-label=\"DeploymenBunny - CleanupBeforeSysprep (opens in a new tab)\" href=\"https:\/\/deploymentbunny.com\/2014\/06\/05\/nice-to-know-get-rid-of-all-junk-before-sysprep-and-capture-when-creating-a-reference-image-in-mdt\/\" target=\"_blank\">DeploymenBunny &#8211; CleanupBeforeSysprep<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\"> 6<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>In this blog post i will cover how to get the best performance out of your Reference Task Sequence and some useful Applications which are also worth adding to your deployment share to improve build times, patching and cleans. Default Task Sequence &#8211; Untouched Improving Performance What I&#8217;ve found over the years of Building and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1352,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,35,20,19],"tags":[193,101,181,182,188,108,106,132],"class_list":["post-1351","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-deployment-toolkit","category-os-deployment","category-windows-10","category-windows-server-2019","tag-customization","tag-deployment","tag-mdt","tag-osd","tag-referenceshare","tag-server","tag-windows","tag-windows10"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Customising Reference Task Sequence - HypervLAB<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hypervlab.co.uk\/?p=1351\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Customising Reference Task Sequence - HypervLAB\" \/>\n<meta property=\"og:description\" content=\"Reading Time:  6 minutesIn this blog post i will cover how to get the best performance out of your Reference Task Sequence and some useful Applications which are also worth adding to your deployment share to improve build times, patching and cleans. Default Task Sequence &#8211; Untouched Improving Performance What I&#8217;ve found over the years of Building and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hypervlab.co.uk\/?p=1351\" \/>\n<meta property=\"og:site_name\" content=\"HypervLAB\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-24T12:07:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-30T08:22:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/HypervLAB-FeaturedImage-CustomisingREFTS.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Simon Lee\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/smoon_lee\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Simon Lee\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hypervlab.co.uk\/?p=1351\",\"url\":\"https:\/\/hypervlab.co.uk\/?p=1351\",\"name\":\"Customising Reference Task Sequence - HypervLAB\",\"isPartOf\":{\"@id\":\"https:\/\/hypervlab.co.uk\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/hypervlab.co.uk\/?p=1351#primaryimage\"},\"image\":{\"@id\":\"https:\/\/hypervlab.co.uk\/?p=1351#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/HypervLAB-FeaturedImage-CustomisingREFTS.png\",\"datePublished\":\"2019-06-24T12:07:15+00:00\",\"dateModified\":\"2019-07-30T08:22:04+00:00\",\"author\":{\"@id\":\"https:\/\/hypervlab.co.uk\/#\/schema\/person\/7d184970612a9c6a5f1babb8b6b4d359\"},\"breadcrumb\":{\"@id\":\"https:\/\/hypervlab.co.uk\/?p=1351#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hypervlab.co.uk\/?p=1351\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/hypervlab.co.uk\/?p=1351#primaryimage\",\"url\":\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/HypervLAB-FeaturedImage-CustomisingREFTS.png\",\"contentUrl\":\"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/HypervLAB-FeaturedImage-CustomisingREFTS.png\",\"width\":1200,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hypervlab.co.uk\/?p=1351#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/hypervlab.co.uk\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Customising Reference Task Sequence\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hypervlab.co.uk\/#website\",\"url\":\"https:\/\/hypervlab.co.uk\/\",\"name\":\"HypervLAB\",\"description\":\"Blogging about all thing Microsoft\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hypervlab.co.uk\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/hypervlab.co.uk\/#\/schema\/person\/7d184970612a9c6a5f1babb8b6b4d359\",\"name\":\"Simon Lee\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/hypervlab.co.uk\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9473a3cf9c75192508eccfd9d072efab80adf04a45083e561d0e3065f681c34c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9473a3cf9c75192508eccfd9d072efab80adf04a45083e561d0e3065f681c34c?s=96&d=mm&r=g\",\"caption\":\"Simon Lee\"},\"description\":\"Hi, I'm Simon an IT Enthusiast, PowerShell Geek, Gamer, and Sound Engineer. I've been working with in the IT Industry for around 6 years and have worked across private and public sector companies. The original idea behind \\\"hypervlab\\\" was that I required an 'RnD' environment which would allow me to be able to replicate any kind of enterprise on-premise environment which I could use for learning and testing without learning in a production environment. So in 2019, I decided to branch out and use the domain for a public facing blog to be able to contribute to the IT Community about all things Microsoft.\",\"sameAs\":[\"https:\/\/hypervlab.co.uk\",\"https:\/\/www.linkedin.com\/in\/simon-john-lee\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/smoon_lee\"],\"url\":\"https:\/\/hypervlab.co.uk\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Customising Reference Task Sequence - HypervLAB","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hypervlab.co.uk\/?p=1351","og_locale":"en_GB","og_type":"article","og_title":"Customising Reference Task Sequence - HypervLAB","og_description":"Reading Time:  6 minutesIn this blog post i will cover how to get the best performance out of your Reference Task Sequence and some useful Applications which are also worth adding to your deployment share to improve build times, patching and cleans. Default Task Sequence &#8211; Untouched Improving Performance What I&#8217;ve found over the years of Building and [&hellip;]","og_url":"https:\/\/hypervlab.co.uk\/?p=1351","og_site_name":"HypervLAB","article_published_time":"2019-06-24T12:07:15+00:00","article_modified_time":"2019-07-30T08:22:04+00:00","og_image":[{"width":1200,"height":600,"url":"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/HypervLAB-FeaturedImage-CustomisingREFTS.png","type":"image\/png"}],"author":"Simon Lee","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/smoon_lee","twitter_misc":{"Written by":"Simon Lee","Estimated reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/hypervlab.co.uk\/?p=1351","url":"https:\/\/hypervlab.co.uk\/?p=1351","name":"Customising Reference Task Sequence - HypervLAB","isPartOf":{"@id":"https:\/\/hypervlab.co.uk\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hypervlab.co.uk\/?p=1351#primaryimage"},"image":{"@id":"https:\/\/hypervlab.co.uk\/?p=1351#primaryimage"},"thumbnailUrl":"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/HypervLAB-FeaturedImage-CustomisingREFTS.png","datePublished":"2019-06-24T12:07:15+00:00","dateModified":"2019-07-30T08:22:04+00:00","author":{"@id":"https:\/\/hypervlab.co.uk\/#\/schema\/person\/7d184970612a9c6a5f1babb8b6b4d359"},"breadcrumb":{"@id":"https:\/\/hypervlab.co.uk\/?p=1351#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hypervlab.co.uk\/?p=1351"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/hypervlab.co.uk\/?p=1351#primaryimage","url":"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/HypervLAB-FeaturedImage-CustomisingREFTS.png","contentUrl":"https:\/\/hypervlab.co.uk\/wp-content\/uploads\/2019\/06\/HypervLAB-FeaturedImage-CustomisingREFTS.png","width":1200,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/hypervlab.co.uk\/?p=1351#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hypervlab.co.uk\/"},{"@type":"ListItem","position":2,"name":"Customising Reference Task Sequence"}]},{"@type":"WebSite","@id":"https:\/\/hypervlab.co.uk\/#website","url":"https:\/\/hypervlab.co.uk\/","name":"HypervLAB","description":"Blogging about all thing Microsoft","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hypervlab.co.uk\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/hypervlab.co.uk\/#\/schema\/person\/7d184970612a9c6a5f1babb8b6b4d359","name":"Simon Lee","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/hypervlab.co.uk\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9473a3cf9c75192508eccfd9d072efab80adf04a45083e561d0e3065f681c34c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9473a3cf9c75192508eccfd9d072efab80adf04a45083e561d0e3065f681c34c?s=96&d=mm&r=g","caption":"Simon Lee"},"description":"Hi, I'm Simon an IT Enthusiast, PowerShell Geek, Gamer, and Sound Engineer. I've been working with in the IT Industry for around 6 years and have worked across private and public sector companies. The original idea behind \"hypervlab\" was that I required an 'RnD' environment which would allow me to be able to replicate any kind of enterprise on-premise environment which I could use for learning and testing without learning in a production environment. So in 2019, I decided to branch out and use the domain for a public facing blog to be able to contribute to the IT Community about all things Microsoft.","sameAs":["https:\/\/hypervlab.co.uk","https:\/\/www.linkedin.com\/in\/simon-john-lee\/","https:\/\/x.com\/https:\/\/twitter.com\/smoon_lee"],"url":"https:\/\/hypervlab.co.uk\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1351"}],"version-history":[{"count":0,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1351\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=\/wp\/v2\/media\/1352"}],"wp:attachment":[{"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hypervlab.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}