Citrix Optimizer custom template for Windows Server 2016

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

Note: for detailed information how to build you own template see the article Creating a custom template for Citrix Optimizer on this website.
Important: the template in this article is for Citrix Optimizer V1! Citrix Optimizer V2 is expected in a couple of weeks and will include a marketplace. I will add the V2 version of my template to this marketplace.

Table of Contents

Introduction

Before diving into the details, this is what the customized GUI looks like. As you can see it starts out the same as the original Windows Server 2016 template I used as a baseline. 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_WindowsServer2016_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:

Let's go through each of the custom sections to see which optimizations are included.

Download the template

You can download the template here:

Citrix Optimizer custom template for Windows Server 2016 - Download template

Citrix_WindowsServer2016_1607_Dennisspan.com_CTXOE_V1_v1.0.xml

See the section An overview of a Citrix Optimizer template in my article Creating a custom template for Citrix Optimizer for more information how to import the template.

After importing the template you see it in the GUI:

Citrix Optimizer custom template for Windows Server 2016 - Select custom template in GUI

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.

For Citrix Optimizer V1 only:
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.

For Citrix Optimizer V1 only:
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.

For Citrix Optimizer V1 only:
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 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. To disable Hibernate I use the PowerShell plugin included in Citrix Optimizer (applies to Citrix Optimizer V1 only). Disabling Hibernate is accomplished by changing the following registry value:

    • Key: HKLM\SYSTEM\CurrentControlSet\Control\Power
    • Name: HibernateEnabled
    • Value: 0
    • Type: DWORD
  • Disable Cortana
    I use the PowerShell plugin included in Citrix Optimizer to disable Cortana (applies to Citrix Optimizer V1 only). 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)
    I use the PowerShell plugin included in Citrix Optimizer to disable CEIP (applies to Citrix Optimizer V1 only). Disabling CEIP is accomplished by changing the following registry value:

    • Key: HKLM\SOFTWARE\Microsoft\SQMClient\Windows
    • Name: CEIPEnable
    • Value: 0
    • Type: DWORD

For Citrix Optimizer V1 only:
For more information on how to set a registry value see the section PowerShell: set a registry value in my article Creating a custom template for Citrix Optimizer.
As mentioned, I used the PowerShell plugin included in Citrix Optimizer to modify registry settings instead of using the Registry plugin which is available as well. It is possible to use the Registry plugin of course, but in the current version there are some drawbacks. See the section Custom entry for Registry in my article Creating a custom template for Citrix Optimizer for more information.

For Citrix Optimizer V1 only:
Please be aware that none of the optimizations in this section includes 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 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.
  • Reduce Application, Security and System event log size to 64 KB
    You can change the size of the event log to anything size you deem fit for your environment. In this template, I chose to go with the same size as configured in the PVS Target Device Optimization Tool. Configuring the size of the event log is accomplished by changing the following registry value:

    • Key:
      • HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\Application
      • HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\Security
      • HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\System
    • Name: MaxSize
    • Value: 10000 (or use a different value)
    • Type: DWORD
  • 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 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 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
  • 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.

For Citrix Optimizer V1 only:
For more information on how to set a registry value see the section PowerShell: set a registry value in my article Creating a custom template for Citrix Optimizer.
As mentioned, I used the PowerShell plugin included in Citrix Optimizer to modify registry settings instead of using the Registry plugin which is available as well. It is possible to use the Registry plugin of course, but in the current version there are some drawbacks. See the section Custom entry for Registry in my article Creating a custom template for Citrix Optimizer for more information.

For Citrix Optimizer V1 only:
Please be aware that none of the optimizations in this section includes rollback.

Conclusion

This template is by no means complete. I strongly urge you to take a look at the optimizations recommended by other esteemed bloggers:

Simply copy an existing template (doesn't have to be the one included in this post 😉 ), customize it and make it your own!

Share this post:
Dennis Span on EmailDennis Span on LinkedinDennis Span on Twitter
Dennis Span
Dennis Span
Dennis Span works as a Senior Citrix Architect for a large insurance company in Vienna, Austria. He holds multiple certifications such as CCE-V, CCIA and CCEA. In 2017, Dennis became a Citrix Technology Advocate (CTA). Besides his interest in virtualization technologies and blogging, he loves spending time with his family as well as snowboarding, playing basketball and rowing. He is fluent in Dutch, English, German and Slovak and speaks some Spanish.

Leave a Reply

Your email address will not be published.

*

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