I've never been a fan of the vanilla out-of-box experience in Windows. Consequently, regardless of the deployment tools, I've always felt it necessary to build a custom reference image. Following is a breakdown of my perspective on Vanilla vs Custom images.
Ultimately, the goal is to always deliver a consistent out-of-box user experience across all deployments. Going with the custom image means front-loading time and effort on customizing, to save huge amounts of time on deployments in the long run.
Here is a brief overview of the process.
New → Virtual Machine
Win10Ent_1809_x64
Generation 2
for 64bit UEFI operating systems, otherwise stick to Generation 1
2048
[x] Use Dynamic Memory
Not Connected
(x) Create a virtual hard disk
selected with defaults, should be creating a 127 GB
disk.Install an operating system later
Finish
Right-Click → Settings
on the new VM2
DVD Drive → Add
DVD, Network, HDD
Standard checkpoints
D:\_hyperv\_checkpoints
D:\_hyperv\_paging
(timestamp) - Fresh VM
Right-Click → Connect
on the new VM to connect to its consoleMedia → DVD Drive → Insert Disk…
and mount the appropriate Windows ISOStart
the VM, don't miss the Press any key…
prompt or you'll miss setup and need to restart the VMNext → Install now
Windows 10 Enterprise
[x] I accept the license terms
and Next
Custom: Install Windows only (advanced)
Drive 0 Unallocated Space 127 GB
so Next
Installing Windows
to completeSettings → Firmware
you'll notice the boot order is updated with bootmgfw.efi
at the top.Let's start with region. Is this right?
Let's start with region. Is this right?
screen, press CTRL+SHIFT+F3
Just a moment…
and the VM should restartAdministrator
, with the Sysprep (System Preparation Tool) window open (it will come up after every restart, until we finally use it)Cancel
to quit SysprepShutdown
Windows so we can checkpoint the VM here(timestamp) - Audit Mode
Run → gpedit.msc → Computer Configuration → Administrative Templates → Windows Components → Cloud Content
Turn off Microsoft consumer experiences
Restart
WindowsVM Settings → Network Adapter → Virtual switch: Hyper-V Virtual Switch
No
to network discovery promptMedia → DVD Drive → Eject
Start → Settings → Time & Language
Eastern Time
Set time automatically
Set time zone automatically
Shutdown
Windows(timestamp) - Pre-Cleanup
Windows Explorer → View → Options
General
tabThis PC
Privacy
section, click Clear
View
tab[ ] Hide empty drives
[ ] Hide extensions
[x] Expand to open folder
[x] Show all folders
[x] Show libraries
Ok
Windows Explorer → Libraries
Windows Explorer → This PC → C:\Users\Public
(timestamp) - Live - Cleanup1
Provisioned Windows 10 apps are documented here.
NOTE: All actions should be performed in an elevated PowerShell
console.
# To get deployed packages across all user profiles: Get-AppxPackage -AllUsers | select PackageFullName| sort PackageFullName # To get provisioned packages which are ready to deploy: Get-AppxProvisionedPackage -Online | select PackageName | sort PackageName # To remove deployed packages via partial name matching: Get-AppxPackage -AllUsers | ?{$_.PackageFullName -like "*name*"} | Remove-AppxPackage # To remove provisioned packages via partial name matching: Get-AppxProvisionedPackage -Online | ?{$_.PackageName -like "*name*"} | Remove-AppxProvisionedPackage -online # Here is a full dump of Get-AppxPackage and Get-AppxProvisionedPackage from build 1809, # and packages that are not to be removed are commented out: $appx = @( #"1527c705-839a-4832-9118-54d4Bd6a0c89_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"c5e2524a-ea46-4f67-841f-6a9465d9d515_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"E2A4F912-2574-4A75-9BB0-0D023378592B_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"F46D4000-FD22-4DB4-AC8E-4E1DDDE828FE_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"InputApp_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy" #"Microsoft.AAD.BrokerPlugin_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy" #"Microsoft.AccountsControl_10.0.17763.1_neutral__cw5n1h2txyewy" #"Microsoft.Advertising.Xaml_10.1804.2.0_x64__8wekyb3d8bbwe" #"Microsoft.Advertising.Xaml_10.1804.2.0_x86__8wekyb3d8bbwe" #"Microsoft.AsyncTextService_10.0.17763.1_neutral__8wekyb3d8bbwe" "Microsoft.BingWeather_4.25.12127.0_x64__8wekyb3d8bbwe" #"Microsoft.BioEnrollment_10.0.17763.1_neutral__cw5n1h2txyewy" #"Microsoft.CredDialogHost_10.0.17763.1_neutral__cw5n1h2txyewy" #"Microsoft.DesktopAppInstaller_1.0.22011.0_x64__8wekyb3d8bbwe" #"Microsoft.ECApp_10.0.17763.1_neutral__8wekyb3d8bbwe" "Microsoft.GetHelp_10.1706.10441.0_x64__8wekyb3d8bbwe" "Microsoft.Getstarted_6.13.11581.0_x64__8wekyb3d8bbwe" #"Microsoft.HEIFImageExtension_1.0.11792.0_x64__8wekyb3d8bbwe" #"Microsoft.LockApp_10.0.17763.1_neutral__cw5n1h2txyewy" "Microsoft.Messaging_3.43.27001.0_x64__8wekyb3d8bbwe" "Microsoft.Microsoft3DViewer_4.1808.15012.0_x64__8wekyb3d8bbwe" #"Microsoft.MicrosoftEdge_44.17763.1.0_neutral__8wekyb3d8bbwe" #"Microsoft.MicrosoftEdgeDevToolsClient_1000.17763.1.0_neutral_neutral_8wekyb3d8bbwe" "Microsoft.MicrosoftOfficeHub_17.8918.5926.0_x64__8wekyb3d8bbwe" "Microsoft.MicrosoftSolitaireCollection_4.1.5252.0_x86__8wekyb3d8bbwe" #"Microsoft.MicrosoftStickyNotes_2.0.13.0_x64__8wekyb3d8bbwe" "Microsoft.MixedReality.Portal_2000.18081.1242.0_x64__8wekyb3d8bbwe" #"Microsoft.MSPaint_4.1807.12027.0_x64__8wekyb3d8bbwe" #"Microsoft.NET.Native.Framework.1.6_1.6.24903.0_x64__8wekyb3d8bbwe" #"Microsoft.NET.Native.Framework.1.6_1.6.24903.0_x86__8wekyb3d8bbwe" #"Microsoft.NET.Native.Framework.1.7_1.7.25531.0_x64__8wekyb3d8bbwe" #"Microsoft.NET.Native.Framework.1.7_1.7.25531.0_x86__8wekyb3d8bbwe" #"Microsoft.NET.Native.Runtime.1.6_1.6.24903.0_x64__8wekyb3d8bbwe" #"Microsoft.NET.Native.Runtime.1.6_1.6.24903.0_x86__8wekyb3d8bbwe" #"Microsoft.NET.Native.Runtime.1.7_1.7.25531.0_x64__8wekyb3d8bbwe" #"Microsoft.NET.Native.Runtime.1.7_1.7.25531.0_x86__8wekyb3d8bbwe" "Microsoft.Office.OneNote_16001.10228.20003.0_x64__8wekyb3d8bbwe" "Microsoft.OneConnect_5.1807.1991.0_x64__8wekyb3d8bbwe" "Microsoft.People_10.1805.1361.0_x64__8wekyb3d8bbwe" #"Microsoft.PPIProjection_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"Microsoft.Print3D_3.0.1521.0_x64__8wekyb3d8bbwe" #"Microsoft.ScreenSketch_10.1806.2112.0_x64__8wekyb3d8bbwe" #"Microsoft.Services.Store.Engagement_10.0.1610.0_x64__8wekyb3d8bbwe" #"Microsoft.Services.Store.Engagement_10.0.1610.0_x86__8wekyb3d8bbwe" #"Microsoft.SkypeApp_14.26.95.0_x64__kzf8qxf38zg5c" #"Microsoft.StorePurchaseApp_11805.1001.8.0_x64__8wekyb3d8bbwe" #"Microsoft.VCLibs.140.00_14.0.25426.0_x64__8wekyb3d8bbwe" #"Microsoft.VCLibs.140.00_14.0.25426.0_x86__8wekyb3d8bbwe" #"Microsoft.VP9VideoExtensions_1.0.12342.0_x64__8wekyb3d8bbwe" "Microsoft.Wallet_2.2.18179.0_x64__8wekyb3d8bbwe" #"Microsoft.WebMediaExtensions_1.0.12341.0_x64__8wekyb3d8bbwe" #"Microsoft.WebpImageExtension_1.0.11551.0_x64__8wekyb3d8bbwe" #"Microsoft.Win32WebViewHost_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"Microsoft.Windows.Apprep.ChxApp_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy" #"Microsoft.Windows.AssignedAccessLockApp_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy" #"Microsoft.Windows.CapturePicker_10.0.17763.1_neutral__cw5n1h2txyewy" #"Microsoft.Windows.CloudExperienceHost_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"Microsoft.Windows.ContentDeliveryManager_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"Microsoft.Windows.Cortana_1.11.5.17763_neutral_neutral_cw5n1h2txyewy" #"Microsoft.Windows.NarratorQuickStart_10.0.17763.1_neutral_neutral_8wekyb3d8bbwe" #"Microsoft.Windows.OOBENetworkCaptivePortal_10.0.17763.1_neutral__cw5n1h2txyewy" #"Microsoft.Windows.OOBENetworkConnectionFlow_10.0.17763.1_neutral__cw5n1h2txyewy" #"Microsoft.Windows.ParentalControls_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy" #"Microsoft.Windows.PeopleExperienceHost_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"Microsoft.Windows.Photos_2018.18051.21218.0_x64__8wekyb3d8bbwe" #"Microsoft.Windows.PinningConfirmationDialog_1000.17763.1.0_neutral__cw5n1h2txyewy" #"Microsoft.Windows.SecHealthUI_10.0.17763.1_neutral__cw5n1h2txyewy" #"Microsoft.Windows.SecureAssessmentBrowser_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"Microsoft.Windows.ShellExperienceHost_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"Microsoft.Windows.XGpuEjectDialog_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"Microsoft.WindowsAlarms_10.1805.1361.0_x64__8wekyb3d8bbwe" #"Microsoft.WindowsCalculator_10.1805.1201.0_x64__8wekyb3d8bbwe" #"Microsoft.WindowsCamera_2018.425.120.0_x64__8wekyb3d8bbwe" "microsoft.windowscommunicationsapps_17.9330.21365.0_x64__8wekyb3d8bbwe" "Microsoft.WindowsFeedbackHub_1.1805.2331.0_x64__8wekyb3d8bbwe" "Microsoft.WindowsMaps_5.1805.1431.0_x64__8wekyb3d8bbwe" #"Microsoft.WindowsSoundRecorder_10.1805.1941.0_x64__8wekyb3d8bbwe" #"Microsoft.WindowsStore_11805.1001.49.0_x64__8wekyb3d8bbwe" "Microsoft.Xbox.TCUI_1.11.28003.0_x64__8wekyb3d8bbwe" "Microsoft.XboxApp_41.41.18001.0_x64__8wekyb3d8bbwe" #"Microsoft.XboxGameCallableUI_1000.17763.1.0_neutral_neutral_cw5n1h2txyewy" "Microsoft.XboxGameOverlay_1.32.17005.0_x64__8wekyb3d8bbwe" "Microsoft.XboxGamingOverlay_2.20.22001.0_x64__8wekyb3d8bbwe" "Microsoft.XboxIdentityProvider_12.44.20001.0_x64__8wekyb3d8bbwe" "Microsoft.XboxSpeechToTextOverlay_1.17.29001.0_x64__8wekyb3d8bbwe" "Microsoft.YourPhone_0.0.12084.0_x64__8wekyb3d8bbwe" "Microsoft.ZuneMusic_10.18052.20211.0_x64__8wekyb3d8bbwe" "Microsoft.ZuneVideo_10.18052.20211.0_x64__8wekyb3d8bbwe" #"Windows.CBSPreview_10.0.17763.1_neutral_neutral_cw5n1h2txyewy" #"windows.immersivecontrolpanel_10.0.2.1000_neutral_neutral_cw5n1h2txyewy" #"Windows.PrintDialog_6.2.1.0_neutral_neutral_cw5n1h2txyewy" ) $appxpp = @( "Microsoft.BingWeather_4.25.12127.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.DesktopAppInstaller_2018.720.2137.0_neutral_~_8wekyb3d8bbwe" "Microsoft.GetHelp_10.1706.10441.0_neutral_~_8wekyb3d8bbwe" "Microsoft.Getstarted_6.13.11581.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.HEIFImageExtension_1.0.11792.0_x64__8wekyb3d8bbwe" "Microsoft.Messaging_2018.727.1430.0_neutral_~_8wekyb3d8bbwe" "Microsoft.Microsoft3DViewer_4.1808.15012.0_neutral_~_8wekyb3d8bbwe" "Microsoft.MicrosoftOfficeHub_2017.1219.520.0_neutral_~_8wekyb3d8bbwe" "Microsoft.MicrosoftSolitaireCollection_4.1.5252.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.MicrosoftStickyNotes_2.0.13.0_neutral_~_8wekyb3d8bbwe" "Microsoft.MixedReality.Portal_2000.18081.1242.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.MSPaint_4.1807.12027.0_neutral_~_8wekyb3d8bbwe" "Microsoft.Office.OneNote_16001.10228.20003.0_neutral_~_8wekyb3d8bbwe" "Microsoft.OneConnect_5.1807.1991.0_neutral_~_8wekyb3d8bbwe" "Microsoft.People_2018.516.2011.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.Print3D_3.0.1521.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.ScreenSketch_2018.731.48.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.SkypeApp_14.26.95.0_neutral_~_kzf8qxf38zg5c" #"Microsoft.StorePurchaseApp_11805.1001.813.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.VP9VideoExtensions_1.0.12342.0_x64__8wekyb3d8bbwe" "Microsoft.Wallet_2.2.18179.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.WebMediaExtensions_1.0.12341.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.WebpImageExtension_1.0.11551.0_x64__8wekyb3d8bbwe" #"Microsoft.Windows.Photos_2018.18051.21218.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.WindowsAlarms_2018.516.2059.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.WindowsCalculator_2018.501.612.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.WindowsCamera_2018.425.120.0_neutral_~_8wekyb3d8bbwe" "microsoft.windowscommunicationsapps_2015.9330.21365.0_neutral_~_8wekyb3d8bbwe" "Microsoft.WindowsFeedbackHub_2018.822.2.0_neutral_~_8wekyb3d8bbwe" "Microsoft.WindowsMaps_2018.523.2143.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.WindowsSoundRecorder_2018.713.2154.0_neutral_~_8wekyb3d8bbwe" #"Microsoft.WindowsStore_11805.1001.4913.0_neutral_~_8wekyb3d8bbwe" "Microsoft.Xbox.TCUI_1.11.28003.0_neutral_~_8wekyb3d8bbwe" "Microsoft.XboxApp_41.41.18001.0_neutral_~_8wekyb3d8bbwe" "Microsoft.XboxGameOverlay_1.32.17005.0_neutral_~_8wekyb3d8bbwe" "Microsoft.XboxGamingOverlay_2.20.22001.0_neutral_~_8wekyb3d8bbwe" "Microsoft.XboxIdentityProvider_12.44.20001.0_neutral_~_8wekyb3d8bbwe" "Microsoft.XboxSpeechToTextOverlay_1.17.29001.0_neutral_~_8wekyb3d8bbwe" "Microsoft.YourPhone_2018.727.2137.0_neutral_~_8wekyb3d8bbwe" "Microsoft.ZuneMusic_2019.18052.20211.0_neutral_~_8wekyb3d8bbwe" "Microsoft.ZuneVideo_2019.18052.20211.0_neutral_~_8wekyb3d8bbwe" ) # This will use the above lists to remove the packages: Get-AppxPackage -AllUsers | Where-Object { $appx -contains $PSItem.PackageFullName } | Remove-AppxPackage -AllUsers Get-AppxProvisionedPackage -Online | Where-Object { $appxpp -contains $PSItem.PackageName } | Remove-AppxProvisionedPackage -Online -AllUsers
(timestamp) - Live - Cleanup2
OneDrive has a proper Uninstaller in 1809, and (as of time of this documentation) running the cleanup script alone leaves the uninstall entry orphaned in Programs and Features, along with some shortcuts in the start menu.
Win+X → Apps and Features
OneDrive
and Uninstall
it, and close the Settings
windowStole this code from here.
NOTE: This should be performed in an elevated PowerShell
console.
function Takeown-File($path) { takeown.exe /A /F $path $acl = Get-Acl $path # get administraor group $admins = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544") $admins = $admins.Translate([System.Security.Principal.NTAccount]) # add NT Authority\SYSTEM $rule = New-Object System.Security.AccessControl.FileSystemAccessRule($admins, "FullControl", "None", "None", "Allow") $acl.AddAccessRule($rule) Set-Acl -Path $path -AclObject $acl } function Takeown-Folder($path) { Takeown-File $path foreach ($item in Get-ChildItem $path) { if (Test-Path $item -PathType Container) { Takeown-Folder $item.FullName } else { Takeown-File $item.FullName } } } Write-Output "Kill OneDrive process" taskkill.exe /F /IM "OneDrive.exe" taskkill.exe /F /IM "explorer.exe" Write-Output "Remove OneDrive" if (Test-Path "$env:systemroot\System32\OneDriveSetup.exe") { & "$env:systemroot\System32\OneDriveSetup.exe" /uninstall } if (Test-Path "$env:systemroot\SysWOW64\OneDriveSetup.exe") { & "$env:systemroot\SysWOW64\OneDriveSetup.exe" /uninstall } Write-Output "Removing OneDrive leftovers" Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:localappdata\Microsoft\OneDrive" Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:programdata\Microsoft OneDrive" Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:systemdrive\OneDriveTemp" # check if directory is empty before removing: If ((Get-ChildItem "$env:userprofile\OneDrive" -Recurse | Measure-Object).Count -eq 0) { Remove-Item -Recurse -Force -ErrorAction SilentlyContinue "$env:userprofile\OneDrive" } Write-Output "Remove Onedrive from explorer sidebar" New-PSDrive -PSProvider "Registry" -Root "HKEY_CLASSES_ROOT" -Name "HKCR" mkdir -Force "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" Set-ItemProperty "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 mkdir -Force "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" Set-ItemProperty "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" "System.IsPinnedToNameSpaceTree" 0 Remove-PSDrive "HKCR" Write-Output "Removing run hook for new users" reg load "hku\Default" "C:\Users\Default\NTUSER.DAT" reg delete "HKEY_USERS\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "OneDriveSetup" /f reg unload "hku\Default" Write-Output "Removing startmenu entry" Remove-Item -Force -ErrorAction SilentlyContinue "$env:userprofile\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\OneDrive.lnk" Write-Output "Removing scheduled task" Get-ScheduledTask -TaskPath '\' -TaskName 'OneDrive*' -ea SilentlyContinue | Unregister-ScheduledTask -Confirm:$false Write-Output "Restarting explorer" Start-Process "explorer.exe" Write-Output "Waiting for explorer to complete loading" Start-Sleep 10 Write-Output "Removing additional OneDrive leftovers" foreach ($item in (Get-ChildItem "$env:WinDir\WinSxS\*onedrive*")) { Takeown-Folder $item.FullName Remove-Item -Recurse -Force $item.FullName }
(timestamp) - Live - Cleanup3
Start Menu
and Taskbar
, and remove any Desktop shortcuts, except for Recycle Bin
.(timestamp) - Live - Cleanup4
Win+X → Apps and Features → Programs and Features (at the bottom)
Turn Windows features on or off
.NET Framework 3.5 (includes .NET 2.0 and 3.0)
OK
and then Let Windows Update download the files for you
dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\sources\sxs /LimitAccess
D:\
above is the drive letter of the mounted ISO(timestamp) - Live - .NET 3.5
I've aggregated the runtime installers from these official and unofficial listings. I keep them on the MDT server in \_prep\_apps\VC++ Runtimes
.
msdia80.dll
to the root of the biggest disk, so clean that up:C:\msdia80.dll
to C:\Program Files\Common Files\Microsoft Shared\VC\msdia80.dll
regsvr32 "C:\Program Files\Common Files\Microsoft Shared\VC\msdia80.dll"
(timestamp) - Live - VC++ Runtimes
Customization via the Settings
app, along with some other features, will not be available without activating Windows. In order to activate in Audit Mode
we need to use slmgr
.
Run the following at an elevated prompt:
slmgr /ipk <product key>
After confirmation pop-up, run:
slmgr /ato
After confirmation pop-up, run:
slmgr /dli
(timestamp) - Live - Activated
Right-Click empty space on the Task Bar → Task Manager
More details
, this will become the default view nowRight-Click empty space on the Task Bar → Cortana → Show Cortana icon
Right-Click empty space on the Task Bar → Taskbar settings
On
Lock the taskbarOff
Automatically hide the taskbar in desktop modeOff
Automatically hide the taskbar in tablet modeOff
Use small taskbar buttonsOn
Use PeekOn
Replace Command Prompt with Windows PowerShellOn
Show badges on taskbar buttonsBottom
Always, hide labels
Notification area → Select which icons appear on the taskbar
On
Always show all icons in the notification area←
Off
Show contacts on the taskbarPersonalization → Start
Off
Show more tiles on StartOn
Show app list in Start menuOff
Show recently added appsOff
Show most used appsOff
Use Start full screenOn
Show recently opened items in Jump Lists on Start or the taskbarChoose which folders appear on Start
On
File ExplorerOn
SettingsOn
DocumentsOn
DownloadsOff
MusicOn
PicturesOff
VideosOff
NetworkOn
Personal folder←
Personalization → Colors
Dark
Home → Apps → Default apps
Internet Explorer
Home → System → Power & sleep
15 min
Export-StartLayout -UseDesktopApplicationID -Path "\\MDT-Server\_prep\_startlayouts\layout.xml"
layout.xml
according to the documentation available here in order to further customize it. For example, taskbar pinned items are not exported and need to be added manually.<?xml version="1.0" encoding="utf-8"?> <LayoutModificationTemplate xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification" xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout" Version="1"> <LayoutOptions StartTileGroupCellWidth="6" /> <DefaultLayoutOverride> <StartLayoutCollection> <defaultlayout:StartLayout GroupCellWidth="6" /> </StartLayoutCollection> </DefaultLayoutOverride> <CustomTaskbarLayoutCollection PinListPlacement="Replace"> <defaultlayout:TaskbarLayout> <taskbar:TaskbarPinList> <taskbar:DesktopApp DesktopApplicationLinkPath="#leaveempty" /> </taskbar:TaskbarPinList> </defaultlayout:TaskbarLayout> </CustomTaskbarLayoutCollection> </LayoutModificationTemplate>
Import-Startlayout -LayoutPath "\\MDT-Server\_prep\_startlayouts\layout.xml" -MountPath $env:SystemDrive\
Administrator
profile.Copy-Item -Path "\\MDT-Server\_prep\_startlayouts\layout.xml" -Destination $env:LOCALAPPDATA\Microsoft\Windows\Shell\LayoutModification.xml
(timestamp) - Live - CustomUE
Internet Explorer
Use recommended security and compatibility settings
Gear → Internet Options → Advanced
Restore advanced settings
Apply
Reset
, [x] Delete personal settings
, Reset
Internet Explorer
Gear → Internet Options
General
https://www.google.com
Security
Internet
zone[ ] Enable Protected Mode
Trusted sites
zonelow
Sites
[ ] Require server verification
*.ufl.edu
[x] Require server verification
Close
Privacy
Pop-up Blocker → Settings
*.ufl.edu
Close
Programs
Notepad
Manage add-ons
Accelerators
Search Providers
Find more search providers
Google Search
EasyList Standard
Close
Manage add-onsManage add-ons
againSearch Providers
Google
as default and delete Bing
Tracking Protection
EasyList
is shown and EnabledClose
Manage add-onsOk
Internet OptionsInternet Explorer
a few times to make sure you get to clear any lingering warnings/popups about the current settings(timestamp) - Live - CustomIE
Start → Settings → Update & Security
Change active hours → 6am - 8pm
Advanced options
Give me updates for other Microsoft products when I update Windows.
Show a notification when your PC requires a restart to finish updating
←
in upper left to return to Windows Update screenCheck for updates
Check for updates
to confirm nothing remains pendingShutdown
Windows(timestamp) - WU
I keep the MSI
's on the MDT server in \_prep\_apps\VPN
.
anyconnect-win-4.6.01103-vpn-predeploy-k9.msi anyconnect-win-4.6.01103-gina-predeploy-k9.msi
Gina
installer will ask to restart, go ahead and restartCisco AnyConnect
icon in the system tray and click it to open the connection windowvpn.ufl.edu
and Connect
Cisco AnyConnect
icon in the system tray againDisconnect
and then switch to profile Gatorlink VPN
and Connect
Cisco AnyConnect
icon in the system tray one last timeDisconnect
and close the windowc:\users\administrator\appdata\local\cisco\cisco anyconnect secure mobility client\preferences.xml
<DefaultUser></DefaultUser>
tag so it's emptySave
and close the file(timestamp) - Live - VPN
Sysprep will not clear the activation key we used earlier, so we need to de-activate manually.
Run the following at an elevated prompt:
slmgr /upk
After confirmation pop-up, run:
slmgr /cpky
We don't want every new profile to have our PowerShell
history, so clear it by running:
Clear-History Remove-Item (Get-PSReadlineOption).HistorySavePath
I have a good track record using CCleaner
to sanitize a system prior to Sysprep, so I keep a portable version on the MDT server in \_prep\_apps\CCleaner_portable
.
CCleaner
and ensure the following settingsOptions → Settings
Custom Clean
Options → Updates
Options → Advanced
[x] Hide warning messages
[x] Save all settings to INI file
[x] Skip User Account Control warning
Options → Privacy
Custom Clean → Windows
Wipe Free Space
under Advanced
Custom Clean → Applications
Custom Clean → Run Cleaner
[x] Do not show me this message again
and Continue/Yes/Ok
if any warnings come upEdge
come up, just terminate it via Task Manager
and Run Cleaner
againRun Cleaner
a few times to confirm nothing is left overRegistry → Scan for Issues → Fix selected issues…
(timestamp) - Live - Final Cleanup
Since our goal is to use copyprofile, we need a prepared XML answer file to feed Sysprep
. Here is what that looks like:
<?xml version="1.0" encoding="utf-8"?> <unattend xmlns="urn:schemas-microsoft-com:unattend"> <settings pass="specialize"> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <CopyProfile>true</CopyProfile> </component> </settings> </unattend>
To simplify executing Sysprep
correctly, every time, I prepared the following batch file:
@echo off set DRIVE=%~d0 set PATH=%~p0 @echo on %windir%\system32\sysprep\sysprep.exe /generalize /oobe /shutdown /unattend:%DRIVE%%PATH%sysprep_CopyProfile.xml
Sysprep
I run \\MDT-Server\_prep\_sysprep\sysprep_CopyProfile.bat
Sysprep
should run without any issues and then shutdown Windows(timestamp) - SYSPREP
Copyprofile is going to copy a variety of content from the Administrator
profile to the Default
profile. Some of this content will be polluted due to our time in Audit Mode
, and will corrupt Edge
and possibly other apps for new profiles.
We need to clean out this content, and it is best to do this in WinPE
after Sysprep
, so none of the content is locked by running processes.
While we're doing this, may as well clean up some other items, if they exist.
WinPE
, I use a mountable ISO from our MDT environmentFirmware → Boot Order
of the VM so the DVD Drive
is at the toprmdir /s /q "C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\" rmdir /s /q "C:\Users\Administrator\AppData\Local\Microsoft\Windows\INetCache\" rmdir /s /q "C:\Users\Administrator\AppData\Local\Microsoft\Windows\WebCache\" rmdir /s /q "C:\Users\Administrator\AppData\Local\MicrosoftEdge\" rmdir /s /q "C:\Users\Administrator\MicrosoftEdgeBackups\" rmdir /s /q "C:\Users\Administrator\Favorites\" rmdir /s /q "C:\Users\Administrator\.cisco\" rmdir /s /q "C:\Users\Default\AppData\Local\Microsoft\WindowsApps\" rmdir /s /q "C:\Users\Default\AppData\Local\Microsoft\Windows\INetCache\" rmdir /s /q "C:\Users\Default\AppData\Local\Microsoft\Windows\WebCache\" rmdir /s /q "C:\Users\Default\AppData\Local\MicrosoftEdge\" rmdir /s /q "C:\Users\Default\MicrosoftEdgeBackups\" rmdir /s /q "C:\Users\Default\Favorites\" rmdir /s /q "C:\Users\Default\.cisco\" rmdir /s /q "C:\Users\Public\" del /q "C:\Users\Administrator\AppData\Local\Microsoft\Windows\WebCacheLock.dat" del /q "C:\Users\Default\AppData\Local\Microsoft\Windows\WebCacheLock.dat"
WinPE
for Capture Phase 3(timestamp) - Live - WinPE Profile Cleanup
net use z: \\MDT-Server\_wimcap
dism /capture-image /imagefile:z:\Win10Ent_x64_1809.wim /capturedir:c:\ /name:"Windows 10 Enterprise - Customized" /compress:maximum