We’ve released Citrix Optimizer version 2.5, and this is (right after version 1.0) the most exciting Optimizer release I’ve worked on.

But before I jump into what we’ve added, I’d like to thank our new team members Zhipan Liu, Xuan Li, and Xiao Zhang. They have been great with C# and WPF (user interface) and have worked hard on all the UI improvements and new features.

Our vision for Optimizer has always been for it to be a versatile tool that you could use for optimizing OS images and as a best practices analyzer or as a resource to help with various configuration scenarios. With v2.5, we’ve added a lot of features that are required to work on the next generation of templates.

Note: Template for Windows 10 build 1903 is not available yet because this version was not released by Microsoft yet. To learn about the status of various Windows builds, we recommend that you look at Windows Insider Program’s Flight Hub. Once build 1903 is generally available, we will release a template in our marketplace.

Without further delay, let’s go over the new and exciting features in this Citrix Optimizer release!

For Template Users

We have added a few features that make it easier to use Optimizer and that will benefit most users. If you have any feedback or ideas for improvement, please let us know.

Template Recommendation

One of my favorite features we added in Optimizer 2.0 was the ability to automatically detect the best template in PowerShell. This saves me a lot of time because I don’t have to remember the names of files — I can just let Optimizer select the best one.

Based on the feedback about the user interface, many customers didn’t know for sure which Windows OS build they were using. In this release, we have decided to use the same logic as we do in PowerShell mode to detect and highlight the recommended template. The recommended template (if available) will have text “Recommended” next to its name (see the image below).

Marketplace Notifications

In version 2.0, we included support for template marketplaces. We’ve been happy to see more and more templates being added to Citrix Optimizer Community Template Marketplace, marketplace for Citrix community templates that has been started by Ryan Butler.

There were two limitations in the version 2.0: It was hard to remove third-party marketplaces (fixed in version 2.1), and you had to open marketplace to find out if any updates were available for your templates.

In version 2.5, we automatically scan for template updates when Optimizer starts. If we detect any, we will notify you in the UI. This behavior is similar to an app store on mobile phones — we display a number to show you how many updates are available.

This number is also interactive. If you click on the icon, the marketplace will open and display only updates. If you want to see all templates, click on the Template Marketplace instead of the number icon.

Access to the internet can be limited in some environments. While we’ve made a few fixes to the proxy configuration, you might still want to disable the “check for new version of Optimizer” and the “check for updated templates” tools. You can make these changes in the new configuration section under Settings as seen below:

New Plugin: Windows Features

We’ve designed Optimizer to support the addition of new modules/plugins. In this release, we’ve added a new module called Features that enables you to disable and/or enable built-in Windows features. For example, you can remove components like SMBv1 or Internet Explorer 11. While we haven’t updated our templates with this new functionality yet (look for it in the next release), you can already customize your own templates. This new module is fully implemented in all parts of Optimizer (UI, engine, reporting, etc.).

Default User Modifications

When you’re using Optimizer to make changes to the registry, you could begin the path with either HKLM (HKEY_LOCAL_MACHINE) or HKCU (HKEY_CURRENT_USER). These are only two drives PowerShell’s registry provider automatically maps.

In the current release, we’ve added support for HKDU (fictional HKEY_DEFAULT_USER) that enables you to make changes to the default user profile. This registry key doesn’t exist on Windows. But when Optimizer encounters a registry key that begins with HKDU, it will automatically load the registry hive file from the default user profile and update the path in the configuration with a dynamically generated path to loaded registry hive.

After Optimizer is done with changes, it will automatically unload the registry hive.

Browse Button for Template Selection

We’ve added a new Browse button to the Local Templates and the Template Builder views. This option allows you to quickly select a template from anywhere on your local system (or network share).

For Template Builders

Based on your feedback, we know that many people like to customize their own templates (and community superstars like Dennis Span, Ryan Butler, David Wilkinson, and John Billekens took this to the next level and started sharing their own creations). While we’ve supported the idea of custom templates from the beginning, creating them was not so easy in earlier versions (just read this blog post from Dennis Span).

In version 2.0, we greatly improved the experiencing by releasing the first version of Template Builder, an easy-to-use UI tool to customize your own templates.

In version 2.5, we’ve made it even easier by gathering all the feedback from previous versions. Instead of writing a new FAQ section, we’ve incorporated that feedback directly in the user interface. If you’ve ever reported problems with deleting registry keys or complained about service name versus service display name, the following features are based on your awesome feedback!

Protected Templates

When you try to create new or to modify existing template, you are no longer allowed to use “Citrix” as an author. When you open a template created by Citrix, you can still make modifications, but first you need to create your own duplicate template. When a template is protected, the “Save” button is disabled (see screenshot). To create a duplicate template, select the “Save as new template” option first.

Smart Selection for Plugins/Modules

Smart Selection is one of my favorite new features in the 2.5 release. You know a feature is really good when you can’t imagine working without it. This is one of those cases.

In previous releases, when you wanted to configure services, schedule tasks, or change other settings, you needed to know exactly what to type in the configuration text box. This can be confusing sometimes. For example, without using PowerShell, it’s almost impossible to find the actual name of a UWP application. We also received few questions about service names — we are using an actual service name and not display name (that is available in Services.msc).

We’ve improved he built-in documentation — just read any of the (i) icons that you see in the template builder. As a next step, we decided to ask users to select an item from the list instead of requiring them to type it in manually.

For Services, UWP apps, Features and Scheduled Tasks, we’ve added a new button called “Select” in the template builder:

When you click on this button, a new window is displayed with all the available entries (in the example below, we display all services running on your local system):

You can use filter, click on any service, and click on Select or simply double-click on any entry in this list and we will automatically fill in all details in your template builder.

I love this feature. It makes modifying existing templates simple, and I can’t imagine working without it.

PowerShell Code Validation

The PowerShell module in Optimizer is by far the most flexible module we are using. You can execute any complex code as long as you stick to the requirements around specific variable name and type when you report the status back to Optimizer. However, Optimizer is quite strict in the expected outcome. Instead of looking for simple error level or $True/$False returns, we require that you return one specific object with predefined name (CTXOE_Result), scope (Global), and variable type (Boolean).

This is required to ensure that the output from the PowerShell code is intentional. PowerShell does not use typical “Return” statements from other languages (my old nemesis … I wrote about this problem 10+ years ago), and we wanted to make sure that PowerShell code is reliable.

In the previous releases of Optimizer, you simply had to know these rules. We’ve started to add more contextual help (see (i) icons in Template Builder), but we also decided to add code validation functionality.

When you click the Run Code button, the currently selected code (Analyze, Execute, or Rollback window) is executed, and results are displayed in the window below. If Optimizer encounters any issues, it will give you more details (e.g. variable was returned but it was not the right type).

Note: Optimizer does not statically analyze your code. It will execute it and retrieve the status after execution. Make sure you execute only the code that you really want to execute on your computer.

Ability to Delete Registry Values

Optimizer always included the ability to delete registry values, but it was similar to secret handshake. You needed to know that by using value “CTXOE_NoValue,” Optimizer would understand it as an instruction to delete the registry value.

In this release, we’ve added the simple check box “Delete Value,” which uses this secret phrase automatically.

Clone/Delete Multiple Entries

In the template builder, you can select multiple entries, and new options are displayed in the toolbar. You can either clone or delete multiple entries at once.

Changing Template Category

In the template builder, you can now edit the template to change the template category. This is a listbox entry (you can select from a predefined list). If you want to use a category that is not yet available, you’ll need to create it in the main view first.

For Futurists

Do you like to be an early adopter and are you always trying to work with cutting-edge technology (in my case, the answers are YES and YES to both questions)? Then we have a bunch of features that will be important for future generations of templates and that you can start using now.

Disabling Modes and URL Links

In the future, we want to use Optimizer to work as a best practices analyzer for various components used in a typical Citrix deployment. The problem is that many of the recommendations made by templates (e.g. recommendation to use end-to-end encryption) can be detected but cannot be automatically fixed. You encounter similar problems once you start analyzing applied policies. You can see the result but cannot (or don’t want to) make actual changes.

With version 2.5, we have added support to specify that your template does not support certain modes. For example if you are analyzing which codec is being used, you can disable Execute and Rollback modes and support only Analyze mode.

This configuration is implemented both in the PowerShell engine (the engine will refuse to execute a mode if it’s disabled) and the user interface, which will automatically hide buttons for modes that are not available (see the image below, where the Optimize button is not available).

Another (surprisingly hard to implement) feature that is important for read-only templates is the ability to provide detailed reporting and actions. In generated HTML reports, we have added detection of URLs, which are converted automatically to clickable objects. This allows you to point to other content (like Citrix Tech Zone) to access more information.

Conditions

There are many exciting features in this release, but Conditions is probably the most important feature and will impact future versions of Optimizer.

Optimizations (and best practices in general) needs to be handled carefully. Components that can be disabled in 99.9999 percent of deployments might be critical for some of your applications. That’s why we always recommend taking snapshots, conducting proper testing, reading what you are disabling, and validating the impact with your end users. For example, some optimizations might be beneficial for persistent machines but can have a negative impact on non-persistent machines.

In this release, we’ve added support for conditions to templates, groups, and entries. Condition is a PowerShell code that returns a status. If the condition is True, the object can be processed by the engine; if it’s false, expecting the following behavior:

  • Template: Will abort execution if condition fails. Example: template was designed for different operating system.
  • Group: All entries in that group will be skipped (similar as if they were not selected). Example: group of optimizations for Microsoft Office will first check if Office is installed.
  • Entry: Entry will be skipped (similar as if it was not selected for execution).

To configure conditions, you need to click on “Edit Condition” option on configuration for template, group or entry:

After clicking on “Edit Condition,” a new window is displayed where you can create your condition. Condition is any piece of PowerShell code that returns a global, Boolean variable $CTXOE_Condition (yes, similar implementation as regular PowerShell module). It can also return the variable CTXOE_ConditionMessage.

In the example below, we are checking to see whether Microsoft Office is installed:

The message that is displayed in the HTML report can be configured in two different ways: you can define “Condition Failed Message” in the UI or you can return the variable $CTXOE_ConditionMessage from the PowerShell code itself. We recommend the second approach if you want to override the default failed message (PowerShell takes precedence) or if you want to handle multiple failed messages.

If condition fails for Group or Entry, it is important to understand that Optimizer will NOT report the entry as failed. It will report it as skipped (same behavior as if it would not be selected for execution).

Miscellaneous

Finally, we made a bunch of smaller fixes, including:

  • After the template builder is closed, the UI will automatically return to the template builder (instead of returning to “Local Templates” view)
  • Power management has been completely rewritten and should be more reliable across different OS versions and builds
  • Fixed issue with creation of empty groups in template builder

Summary

Citrix Optimizer 2.5 is an exciting release, especially if you are using your own templates. We want to hear about your experience with it and find out your ideas for making Optimizer better. Spread the word on social media or contact us through this web form.

Your Optimizer Team,

Martin Zugec, Manoj Kumar, Luis Salinas, Zhipan Liu, Xuan Li, Xiao Zhang


Citrix Tech Bytes – Created by Citrix Experts, made for Citrix Technologists! Learn from passionate Citrix Experts and gain technical insights into the latest Citrix Technologies.

Click here for more Tech Bytes and subscribe.

Want specific Tech Bytes? Let us know! tech-content-feedback@citrix.com.