Whenever I create a new Windows Server 2016 or 2019 Virtual Machine (VM) template for customers, I mostly add the BgInfo tool in the base image (also called golden image) and set it so it
starts up automatically whenever a user logs on to the server. To automate this process, I wrote a PowerShell script which does all of the following:
- Create the BgInfo folder on the C: drive if the folder does not already exist.
- Download the latest BGInfo tool from the Windows Sysinternals webpage.
- Extract and cleanup the BGInfo.zip file in the BgInfo folder.
- Download the logon.bgi file which holds the preferred settings.
- Extract and cleanup the LogonBgi.zip file in the BgInfo folder.
- Create the registry key (regkey) to AutoStart the BgInfo tool in combination with the logon.bgi config file.
- Start BgInfo for the first time.
- Exit the PowerShell window upon completion.
More information about the script can be found on my blog: https://wmatthyssen.com/2019/09/09/powershell-bginfo-automation-script-for-windows-server-2016-2019/