VMware Horizon – Setup Windows 10 template – Generalize Windows

Release date: February 7th 2019

Welcome to my VMware Horizon series. In this session I will describe how I generalized my Windows 10 Build 1809.

After I finished customizing and updating Windows 10 in my previous session, I’m now ready to Sysprep and create a mandatory profile. Before I sysprep my image I will remove all unnecessary Windows App Packages. I have attached a txt-file at the bottom with the commands used in this session.

First I’ll start a Powershell session as administrator



I disable app-suggestions for new users by adding this reg-key:



Next, I run “Get-AppxPackage -AllUsers | Remove-AppxPackage” to list and remove all app packages from all users. This will produce a lot of errors, not to worry. I now run “Get-AppxProvisionedPackage -online | Remove-AppxProvisionedPackage –online” to make sure new users don’t get app packages installed in future.



Now it’s time to sysprep the image. First I will create an answer-file for sysprep, unattend.xlm. I have modified mine as follows. A sample file is attached at the end of this page.



I copy unattend.xml to C:\Windows\System32\Sysprep



From an administrative cmd-prompt, I start sysprepping by running this cmd: “c:\windows\system32\sysprep\sysprep.exe /oobe /generalize /mode:vm /unattend:c:\windows\system32\sysprep\unattend.xml /reboot”



Once my VM is restarted, I will create a mandatory profile. In Windows Explorer, Right-click “This PC” and click Properties.



Next I select Advanced System Settings



I Click “Settings” under User Profiles



Select Default Profile, Copy To…



Copy profile to “C:\Users\Mandatory.v6” and click “Change” to set permissions



Select the user group: Authenticated Users



Do NOT check the Mandatory profile option



Back in the User Profile dialogue box, delete the defaultuser0-profile




Click OK to exit User Profiles windows



Back in Windows Explorer, I browse to C:\Users\Mandatory.v6 folder, choose view “Hidden Items”



I rename the file ntuser.dat to ntuser.man



Next I choose to view protected operating system files from View Options



I delete all ntuser*.* files except ntuser.ini and ntuser.man



Lastly, I revert changes in the View Options I made above.

Commands used in this session: generalize_cmd

Unattend sample file: Unattend_xml

PS: Beware of formatting when doing copy/paste!


That concludes my session about how I generalized and prepared Windows in my template. My next logical step will be applications and agents, covered here: VMware Horizon View Setup Template – Install Agents and applications


Recommended reading:

VMware Tech Zone: Creating an Optimized Windows Image for a VMware Horizon Virtual Desktop


VMware Horizon View Setup Template

VMware Horizon View planning, deployment etc.

Disclaimer: Every tips/tricks/posting I have published here, is tried and tested in different it-solutions. It is not guaranteed to work everywhere, but is meant as a tip for other users out there. Remember, Google is your friend and don’t be afraid to steal with pride! Feel free to comment below as needed.