Create a VMware vSphere template for Windows Server 2019
This article provides guidance for creating a Windows Server 2019 VMware vSphere virtual machine template.
Prerequisites
Note
This guide assumes that you have some VMware vSphere familiarity and you have knowledge on how to install Windows Server. It also does not review either VMware or Windows best practices.
VMware vSphere 6.5 and above
Although it can be used locally, for faster deployment it's recommended to upload the file to a vSphere datastore or to vCenter content library.
Creating Windows Server 2019 VM template
Deploying and installing Windows Server
Deploy a new virtual machine.






Make sure to select Microsoft Windows Server 2016 or later (64-bit) as the guest OS.

Point to the Windows Server ISO file location.


Power on the VM and start the Windows Server installation.







Post-installation
Before converting the VM to a template, several actions are required.
Install VMware Tools and restart.









Perform Windows updates.
Change PowerShell execution policy to
Bypassby running theSet-ExecutionPolicy -ExecutionPolicy Bypasscommand in PowerShell (can be later tuned on via group policy or a PowerShell script).Allow WinRM communication to the OS by running the
allow_winrmPowerShell script.None of the following steps are mandatory but should be considered for a Windows template:
Disable user account control (can be later turned on via group policy or a PowerShell script)
Turn off Windows Defender Firewall (can be later turned on via group policy or a PowerShell script)
Disable Internet Explorer Enhanced Security Configuration (ESC) (can be later turned on via group policy or a PowerShell script)
Enable Remote Desktop Services
From PowerShell, install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))Install all baseline applications you may want to include in your template.
Convert to template
Reduce the VM CPU count and memory resources to the minimum and convert the VM to template, switch the CD/DVD drive to client device as well disconnect it and convert the VM to template.

