Ideally you already have a snapshot you maintain and have hardened, and just have to clone it when you need new servers deployed. If you have to build a clean image to use for your future VMs: it’s usually easier to start with an existing VM you’ve configured, because it already has everything you need installed, but it might also have other stuff installed that you don’t necessarily want on every new VM, so here’s a way I quickly set up a new server image:
Install a clean version of Windows on a new VM
Set up your networking stack, and run Windows Update and install all the updates available
Export the installed roles from your existing server https://www.ntweekly.com/2017/04/17/export-installed-roles-and-features-on-windows-server-2016-and-2012/
Import-Csv C:\Temp\Roles.csv | foreach{Add-WindowsFeature $_.name }
Import your encryption certificates into the new server
Install Web Platform Installer
Using Web Platform Installer install any components you might need, ex: WebDeploy 3.6 and URL Rewrite are some I find very useful.
Set up Windows or IIS for SSL Perfect Forward Secrecy and TLS 1.2. Depending on your audience, you might want to keep only TLS 1.2, or support TLS 1.1. Here’s the script I use: https://www.hass.de/content/setup-microsoft-windows-or-iis-ssl-perfect-forward-secrecy-and-tls-12
Now whenever you need a new web server, you can just clone this VM, assign it a new IP, join it to your domain and you’re ready to go. Remember to keep your base image up-to-date with any changes you make to your production environment.
Quick Links
Legal Stuff