MDT – Windows 10 Customize Script

By | November 12, 2019

In the past I’ve always deployed Windows operating systems by building a reference image in Audit Mode, customizing the default user profile, then sysprepping, and then finally capturing. Because using CopyProfile during sysprep can have some strange side effects, I’ve decided to just script the customizations immediately after applying the image to the disk. I can copy our corporate branded backgrounds  and modify the default user profile before even the first reboot. I am also using a custom StartLayout file that I’ve called “LayoutModification.xml”. 3 things need to be in the script root:

  1. Wallpaper folder (this contains 2 folders called 4k and DefaultRes that contains the corporate-branded images. The 4k folder contains images with the same dimensions as the images located in C:\Windows\Web\4K\Wallpaper\Windows on a Windows 10 machine. The DefaultRes folder contains a single 1920×1200 img0.jpg image)
  2. Lockscreen folder (This contains a single 1920×1200 img100.jpg image that gets copied to C:\Windows\Web\Screen.)
  3. LayoutModification.xml file (For this, you will modify an existing Start menu layout and then export it using Export-StartLayout. More info here: https://docs.microsoft.com/en-us/windows-hardware/customize/desktop/customize-start-layout)

By doing things this way, I’ve also decided to not even bother building a reference image at all and instead, I now just load the Windows 10 media into MDT and deploy directly from that. It may not be fully patched at deployment time, but that’s still easy enough to do after the fact. I put the below text into a .ps1 file I call “CustomizeWindowsOffline.ps1”. I then put this into a “Run PowerShell Script” task after “Inject Drivers” in the PostInstall section of my task sequence.

By using Write-Host, it will output specific text of each operation to it’s own log file that will be created post-task sequence execution.

This script is not perfect but works for me, for now.