Citrix Optimizer custom template for Windows Server 2016

A while ago I created a Citrix Optimizer custom template for Windows Server 2016 build 1607. You are welcome to use or modify this template as you see fit.

Change Log
15.03.2019: updated article as well my custom template for Windows Server 2016 to version 2.0.0.109 of Citrix Optimizer.
Note: for detailed information about Citrix Optimizer and a detailed explanation on how to build you own template see the article Creating a custom template for Citrix Optimizer on this website.

Table of Contents

Introduction

Before diving into the details, this is what the customized GUI looks like.

When you add my template in the subdirectory Templates of the Citrix Optimizer installation root it is automatically loaded.

Citrix Optimizer custom template for Windows Server 2016 - Template visible in V2 GUI

When opening the template, you can see that it starts out the same as the original Windows Server 2016 template provided by Citrix. I used this template as a baseline to create my own. The last four sections are custom sections.

Citrix Optimizer custom template for Windows Server 2016 - Custom GUI

As said, the template is based on a copy of the original template for Windows Server 2016 (Citrix_Windows_Server_2016_1607.xml).

The first thing I did after copying the original Windows Server 2016 template was to remove the section Optional Components as shown in the screenshot below.

Citrix Optimizer custom template for Windows Server 2016 - Optional Components removed

Than I added the following sections:

In my humble opinion, optimizations should reflect the use-case. Not all optimizations are required or even recommended in all scenarios. For sure there are optimizations that fit all environments, operating systems and deployment methods, but some optimizations should only be applied in certain circumstances. For example:

Download the template

There are two ways how you can download the template.

First of all you can download this template in the Citrix Community Marketplace created by Citrix CTP Ryan Butler. To connect to this marketplace, go to Template Marketplace in the GUI, click on +Add New Marketplace and enter the following URL:

https://raw.githubusercontent.com/ryancbutler/Citrix_Optimizer_Community_Template_Marketplace/master/communitymarketplace.xml

For more information on the Template Marketplace component in Citrix Optimizer see my article Creating a custom template for Citrix Optimizer.

Secondly, you can download the template here:

Citrix_Windows_Server_2016_1607_Dennisspan.com.xml v1.0 for CTXOE V2.x

Simply copy this template in the Templates folder of Citrix Optimizer as described in the section An overview of a Citrix Optimizer template in my article Creating a custom template for Citrix Optimizer.

After importing the template you see it in the GUI:

Citrix Optimizer custom template for Windows Server 2016 - Template visible in V2 GUI

Now let’s go through each of the custom sections to see which optimizations are included.

Section – DS: Disable Active Setup

In this section both the 32-bit and 64-bit Active Setup are disabled.

Citrix Optimizer custom template for Windows Server 2016 - GUI Disable Active Setup

The main issue with Active Setup is that it is only executed on published desktops, not published applications. This leads to inconsistent configurations between users. Also, a user can live without the Active Setup window that appears at first logon in the top left corner of the screen. See Citrix CTP Helge Klein’s article Active Setup Explained for more information.

There are various ways how to disable Active Setup. I choose to rename both the 32-bit and 64-bit registry keys. Renaming the parent registry key automatically disables all individual Active Setup entries beneath it. One big advantage is that you do not need to worry about disabling individual settings.

Original key names:

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components
  • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Active Setup\Installed Components

Key names after being renamed (and thus disabled):

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\_DISABLED Installed Components_2018-11-10_10-24-11
  • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Active Setup\_DISABLED Installed Components_2018-11-10_10-24-11

The new name of the registry keys includes a time stamp. The advantage of this approach is that this makes the key name unique. Without a unique name, an error would be thrown when you execute this optimization for a second time. The simple reason being that you cannot use the same name twice.

To disable Active Setup I use the PowerShell plugin included in Citrix Optimizer. Please see the section PowerShell: rename a registry value in my article Creating a custom template for Citrix Optimizer for more details on the PowerShell code used.

This optimization does not include rollback.

Section – DS: Disable Other Services

In this section I disable a number of additional services that are not disabled by Citrix Optimizer by default.

Citrix Optimizer custom template for Windows Server 2016 - GUI Disable Other Services

The following services are disabled:

  1. App Readiness (service name: AppReadiness)
    Note: this can cause issues with Windows Update.
    Gets apps ready for use the first time a user signs in to this PC and when adding new apps. This service causes black screen issues on Windows Server 2016. This saved me 14 seconds logon time!
  2. Device Setup Manager (service name: DsmSvc)
    Enables the detection, download and installation of device-related software. If this service is disabled, devices may be configured with outdated software, and may not work correctly.
  3. WAP Push Message Routing Service (service name: dmwappushsvc)
    WAP Push Message Routing Service.
  4. Network Connection Broker (service name: NcbService)
    Brokers connections that allow Microsoft Store Apps to receive notifications from the internet.
  5. Program Compatibility Assistant Service (service name: PcaSvc)
    This service provides support for the Program Compatibility Assistant (PCA). PCA monitors programs installed and run by the user and detects known compatibility problems. If this service is stopped, PCA will not function properly.
  6. Quality Windows Audio Video Experience (service name: QWAVE)
    Quality Windows Audio Video Experience (qWave) is a networking platform for Audio Video (AV) streaming applications on IP home networks. qWave enhances AV streaming performance and reliability by ensuring network quality-of-service (QoS) for AV applications. It provides mechanisms for admission control, run time monitoring and enforcement, application feedback, and traffic prioritization.
  7. Radio Management Service (service name: RmSvc)
    Radio Management and Airplane Mode Service.
  8. Sensor Data Service (service name: SensorDataService)
    Delivers data from a variety of sensors.
  9. Sensor Service (service name: SensorService)
    A service for sensors that manages different sensors’ functionality. Manages Simple Device Orientation (SDO) and History for sensors. Loads the SDO sensor that reports device orientation changes. If this service is stopped or disabled, the SDO sensor will not be loaded and so auto-rotation will not occur. History collection from Sensors will also be stopped.
  10. WalletService (service name: WalletService)
    Hosts objects used by clients of the wallet.
  11. Windows Error Reporting Service (service name: WerSvc)
    Allows errors to be reported when programs stop working or responding and allows existing solutions to be delivered. Also allows logs to be generated for diagnostic and repair services. If this service is stopped, error reporting might not work correctly and results of diagnostic services and repairs might not be displayed.
  12. Windows Insider Service (service name: wisvc)
    Provides infrastructure support for the Windows Insider Program. This service must remain enabled for the Windows Insider Program to work.

To disable these services I use the Services plugin included in Citrix Optimizer. For more information on how to use this plugin see the section Custom entry for Services in my article Creating a custom template for Citrix Optimizer.

Section – DS: Miscellaneous

In this section I optimize a couple of miscellaneous settings.

Citrix Optimizer custom template for Windows Server 2016 - GUI Miscellaneous

The following configurations can be made on any image independent of how the image is deployed, whether it is persistent or not and whether the machine is a virtual or physical machine.

  • Disable Cortana
    Disabling Cortana is accomplished by changing the following registry value:

    • Key: HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search
    • Name: AllowCortana
    • Value: 0
    • Type: DWORD
  • Disable Customer Experience Improvement Program (CEIP)
    Disabling CEIP is accomplished by changing the following registry value:

    • Key: HKLM\SOFTWARE\Microsoft\SQMClient\Windows
    • Name: CEIPEnable
    • Value: 0
    • Type: DWORD
  • Disable Data Execution Prevention (DEP)
    It is best practice to disable DEP (see the Citrix Windows 10 Optimization Guide).
    To disable DEP I use the PowerShell plugin included in Citrix Optimizer. I use PowerShell code to execute the command bcdedit.exe /set nx AlwaysOff. For more information on exactly how DEP is disabled using PowerShell and bcdedit.exe see the section PowerShell: run an executable in my article Creating a custom template for Citrix Optimizer.
  • Disable Hibernate
    Hibernation is pretty useless on a machine that runs in the data center and can therefore be disabled. Disabling Hibernate is accomplished by changing the following registry value:

    • Key: HKLM\SYSTEM\CurrentControlSet\Control\Power
    • Name: HibernateEnabled
    • Value: 0
    • Type: DWORD
  • Disable IPv6
    Disabling IPv6 is accomplished by changing the following registry value:

    • Key: HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters
    • Name: DisabledComponents
    • Value: 255 (decimal)
    • Type: DWORD

Please be aware that the optimization Disable Data Execution Prevention in this section does not include rollback.

Section – DS: NON-PERSISTENT Only

In this section I added optimizations that apply to non-persistent scenarios only. Non-persistent means that changes to the local machine are not retained; when the machine reboots, all changes are lost.

You want to include the settings in this section to your image when you plan to deploy this image to non-persistent virtual machines, for example using technologies such as Citrix Machine Creation Services (MCS) or Citrix Provisioning Server (PVS). The deployment technology is not relevant; these settings apply to all non-persistent scenarios.

Citrix Optimizer custom template for Windows Server 2016 - GUI NON-PERSISTENT only

There are two main reasons to exclude or change settings for non-persistent machines:

  1. The setting or configuration is not relevant, because of the fact that settings are not retained (thus are lost when the machine is rebooted).
  2. The setting or configuration takes up space in temporary memory, whether it is a virtual hard disk (a cache disk) or RAM. You want to keep the usage of this temporary memory to a minimum.

Let’s take a look at exactly which settings are included:

  • Disable clear page file at shutdown
    There is no need to clear the page file when it “cleared” anyway at the next reboot. Clearing the page file is accomplished by changing the following registry value:

    • Key: HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
    • Name: ClearPageFileAtShutdown
    • Value: 0
    • Type: DWORD
  • Disable Machine Account Password Changes
    Machine account password changes would get lost on the next reboot. Therefore it is necessary to disable it. This is accomplished by changing the following registry value:

    • Key: HKLM\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters
    • Name: DisablePasswordChange
    • Value: 1
    • Type: DWORD
  • Disable Move to Recycle Bin
    Disable Move to Recycle Bin is accomplished by changing the following registry value:

    • Key: HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
    • Name: NoRecycleFiles
    • Value: 1
    • Type: DWORD
  • Disable System Recovery
    It is best practice to disable System Recovery (see the Citrix Windows 10 Optimization Guide). To disable System Recovery I use the PowerShell plugin included in Citrix Optimizer. I use PowerShell code to execute the command bcdedit.exe /set recoveryenabled no. For more information concerning the PowerShell code see the section PowerShell: run an executable in my article Creating a custom template for Citrix Optimizer.
  • Native Image Generation (NGEN.exe) 32-bit and 64-bit
    THIS IS SLOW, it’s normal for this operation to take a long time (about 2 minutes on a clean Windows Server 2016 version 1607). This optimization pre-compiles .NET assemblies instead of using the just-in-time compilation using NGEN.exe. Does not support analyze/rollback modes, but it is generally safe to use.
    Note: the status of this setting is always displayed as “optimized” within Citrix Optimizer. Please ignore this status and always execute this item when sealing your image. I copied the PowerShell code from the official Windows 10 version 1803 template included in Citrix Optimizer.

Citrix App Layering

In case you are preparing your image using Citrix App Layering, you can use the template offered in this article. However, after optimizing all settings using my template, you should run Citrix Optimizer a second time using the App Layering Supplement template create by Citrite Rob Zylowski.

You can download this template from Sharefile: https://citrix.sharefile.com/share/view/s3aabe5b29a04859b

You should also read Rob’s article Optimizing Windows and Citrix App Layering on the official Citrix Blogs website.

Conclusion

This template is by no means complete. Also, this template contains my personal list of recommended optimizations and should work for all organizations. I do however recommend you to test this template thoroughly before using it in production. The responsibility of using this template lies solely with you.

I also urge you to take a look at the optimizations recommended by other esteemed bloggers:

Use one of the Citrix standard templates, a template from the marketplace or create your own template. Just make sure that you optimize your image!

8 thoughts on “Citrix Optimizer custom template for Windows Server 2016

  1. HI Denis,
    In V2.0 there is the appreadiness service disabled by default. I did that in my optimization routines too, but found that when the service is disabled certain standard windows updates did not apply. We even had to reinstall machines once windows update failed.
    Did you have similar findings? We currently do not disable appreadiness svc while optimizing, we stop the svc during boot of the clones (MCS,PVS)
    Regards
    Reinhard

    • Hi Reinhard,

      Yes, you are right. The App Readiness service is a tricky one. On the one hand it has a real impact on logon times (up to 14 seconds in some of my environments). At the same time it can have a negative impact on the stability of Windows Updates. In the description of the App Readiness service in my custom template I do state that disabling this service may cause issues with the Windows Update service. Your approach is definitely a good one. I will have to re-think whether or not to disable this service in my template. Thanks for reaching out; your point is a valid one. 🙂

      Bye “und schöne Grüße”,

      Dennis

  2. Hi Dennis,

    Is there still a need to run the VMWare Optimizer (VDI Like a Pro template) too if you run this Template?
    I’m currently running tests with your template, keep up the good work 😉

    Thanks,

    Ard

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.