Citrix Workspace app unattended installation with PowerShell

This article explains how to build your Citrix Workspace app unattended installation with PowerShell and shows you how to tweak its configuration.

Note: for detailed information on how to install and configure Citrix Receiver see the article Citrix Receiver unattended installation with PowerShell on this website.
Change Log
24.09.2018: added Prevent an unexpected MSI repair from launching.
12.10.2018: added Prevent the splash screen “Citrix Receiver is now Citrix Workspace App” from showing. Thanks to Thorsten Enderlein (@endi24) for bringing this to my attention.
27.12.2018: updated article and complete installation script to version 1812 released on the 14th of December 2018 (previous version described in this article: 1809).
04.05.2019: updated article and complete installation script to version 1904 released on the 30th of April 2019 (previous version described in this article: 1812).
29.07.2019: updated article and complete installation script to version 1907. I also updated the handling of the return code of the Workspace app installer as described in the following article: https://support.citrix.com/article/CTX257546. This new handling of the return code first appeared in version 1904.1 of Citrix Workspace (in version 1904 this was not changed yet). Rest assured, the new handling of the return code in the complete installation script also works when installing versions before 1904.1.
02.10.2019: updated article and complete installation script to version 1909 released on the 19th of September 2019.

 

 

Table of Contents

Introduction

Citrix Workspace app is a client component in a Citrix infrastructure that allows a user to launch resources in a Citrix Virtual Apps and Desktops (CVAD) environment, formerly known as XenApp and XenDesktop. With resources, I mean for example (Saas) applications and virtual desktops.

Installing and configuring Citrix Workspace app for Windows requires careful planning. You need to decide which components to enable, how to configure the default device access behavior, how to configure Citrix Workspace app group policies, whether or not to allow single sign-on, and more. In this article, I do my best to clarify most of these challenges.

Citrix Workspace app replaces Citrix Receiver. The latest (and last) version of Receiver is 4.12. The last LTSR release is version 4.9.6000. The version of Citrix Workspace app described in this article is 1909, released in September 2019.

So what is different in Citrix Workspace app compared to Receiver? Well, concerning files, folders, registry keys, and values, Citrix Workspace app is very similar to Receiver, with the following differences:

  • The name changed from Receiver to Workspace app. However, many of the known installation paths and registry keys did not change, for example:
    • C:\Program Files (x86)\Citrix\ICA Client
    • C:\Program Files (x86)\Citrix\ICA Client\Receiver
    • HKLM\SOFTWARE\WOW6432Node\Citrix\ICA Client
    • HKLM\SOFTWARE\WOW6432Node\Citrix\Receiver
    • HKLM\SOFTWARE\WOW6432Node\Citrix\ReceiverInside
  • The icon color changed from black to blue.
  • An embedded browser for SaaS applications was added (read more about this here).
  • With each new version, new features are released, for example, support for Citrix Casting (to a Workspace Hub) and support for Citrix Files (the new name for Citrix ShareFile). In most cases, this means that a new MSI installation file is added to the Workspace app installer.

Please see the Citrix documentation What’s new in Citrix Workspace app for Windows for more details.

I strongly suggest you read the excellent article Citrix Workspace app 1909 written by CTP Carl Stalhood. This is the most detailed article on Workspace app available.

Installing and configuring Citrix Workspace app

Installing and configuring Citrix Workspace app is not as straightforward as one might think. Many details can either make or break your deployment. Read and implement the sections below to ensure a smooth and successful deployment.

Summary

  • Target device:
    Workspace app can be installed both on your virtual servers and desktops (alongside the VDA) as well as on the local client device. This all depends on your Citrix infrastructure and your access scenarios.
  • Installation file name:
    CitrixWorkspaceApp.exe (or, after renaming, CitrixWorkspaceAppWeb.exe)
  • File size:
    You may have noticed that the size of the file CitrixWorkspaceApp.exe is more than twice the size compared to the file CitrixReceiver.exe (version 4.12).
    Citrix Workspace App unattended installation with PowerShell - File size compared to Receiver
    The reason for this is the new embedded browser for secure Saas applications and the new feature Citrix Screen Casting. The Citrix Receiver 4.12 executable includes 53 files. The executable of Citrix Workspace app includes three more, namely the new MSI installer file CtxBrowserInstaller.msi, which is more than 50 MB in size, the new installer file WinDockerInstaller.msi (5 MB in size) and the new installer file AppProtection.msi (1,5 MB in size). The file CtxBrowserInstaller.msi was introduced in Workspace app version 1808. The file WinDockerInstaller.msi was introduced in version 1809. The file AppProtection.msi was in introduced in Workspace app version 1909 (protects against keyloggers and screen scrapers). The name WinDockerInstaller is a bit cryptic, but it contains the new feature Citrix Screen Casting. Versions 1810 to 1907 do not include any new MSI files (only updated ones).
    Citrix Workspace App unattended installation with PowerShell - MSI installers compared
    Citrix describes the embedded browser as follows: “The Citrix Workspace-embedded browser is a native browser running on the client machine embedded in the Citrix Workspace security sandbox. This gives end-users the best performance for rendering web pages of SaaS applications. The secure sandbox protects the end-user and the enterprise against malware, performance degradation, data loss, and unintended end-user behavior.” The embedded browser is launched automatically when a SaaS application is started. The embedded browser is not the same as the Citrix Secure Browser (for more information see the article Citrix Workspace: Embedded Browser vs Secure Browser Service vs Secure Browsing). The installation path for the embedded browser is: C:\Program Files (x86)\Citrix\ICA Client\Browser.
  • Version (latest):
    1909 (released in September 2019)
  • Installation parameters (command-line switches):
    See the section Workspace app command-line switches below.
  • Uninstallation parameters (command-line switches):
    The following two command line switches are required to uninstall Citrix Workspace app: /silent /uninstall. The /noreboot parameter is not needed during a silent installation according to the Citrix documentation.
  • Installation dependencies:
    No
  • Other dependencies:
    No
  • Reboot required:
    Yes (for certain components such as Single Sign-on, /includeSSON)
  • ADMX files:
    Yes (see the section on Group Policies in the conclusion of this article)
  • Ports and firewall:
    No (outbound communication only, e.g. port 80, 443, 1494, 2598)
  • Download location:
    Workspace app 1909 for Windows
  • Reference:
    Configure and install Citrix Workspace app using command-line parameters

Citrix Workspace app installation file (CitrixWorkspaceApp.exe)

The latest version of Citrix Workspace app can be downloaded here. The download contains one file: CitrixWorkspaceApp.exe. This file contains several MSI files; one MSI installer per component. This is the list of components for Workspace app 1909:

  1. AppProtection.msi (new since Workspace app 1909)
  2. AuthManager.msi
  3. CitrixHDXMediaStreamForFlash-ClientInstall.msi
  4. CtxBrowserInstaller.msi (new since Workspace app 1808)
  5. DesktopViewer.msi
  6. GenericUSB.msi
  7. ICAWebWrapper.msi
  8. RIInstaller.msi
  9. SelfServicePlugin.msi
  10. SSONWrapper.msi
  11. Vd3dClient.msi
  12. WebHelper.msi
  13. WinDockerInstaller.msi (new since Workspace app 1809)
Note:
Use the following command to extract the individual MSI files from the installation file:

CitrixWorkspaceApp.exe /extract %directory%
For example:
C:\CitrixWorkspaceApp.exe /extract C:\Temp\WorkspaceAppExtractedMake sure to create the destination directory beforehand! As stated, this command only extracts the MSI files. If you want to extract all files, use an archiving tool such as 7-Zip.
Reference:
How to Manually Extract, Install, and Remove Individual .msi Files from Receiver.exe or ReceiverEnterprise.exe.

The version is not displayed in the file name, so the file name is the same for each version of Workspace app. To see the version of the executable, you have to take a look at the Details tab in the file properties.

The version displayed in the details tab is always a little bit different than the commercial version displayed on the official Citrix download page.

Example:

Citrix Workspace App unattended installation with PowerShell - Download page file version 1904

Version 1904 of Citrix Workspace app has product version 19.4.0 and file version 19.4.0.34.

Citrix Workspace App unattended installation with PowerShell - File properties file version

Another thing you should know about the installation file is that renaming it from CitrixWorkspaceApp.exe to CitrixWorkspaceAppWeb.exe changes the installation behavior. See the section Prevent the Add Account Window for more details.

Do you know what renaming the file name does under the hood? It sets the registry value CitrixReceiverWeb (DWORD) in the registry key HKLM\Software\Wow6432Node\Citrix\Installer to 1. This registry value is also created when the original file name is used, but then the value is set to 0. And no, I did not make a spelling mistake; the name of the registry value does include the old name Receiver and not WorkspaceApp.

Citrix Workspace App unattended installation with PowerShell - Registry value connected to renaming Workspace App exe

Citrix Workspace app command-line switches

There are various parameters you can parse. For a detailed overview of all parameters please refer to the article Configure and install Citrix Workspace app for Windows using Command Line parameters. I strongly suggest reading the entire article before deploying Citrix Workspace app.

You can also use the Citrix Receiver Commandline Helper Tool to help you build the exact command line syntax. This tool has not yet been renamed to Citrix Workspace app Commandline Helper Tool.H:\#Private\#Dennisspan.com\Website\Images\Citrix Receiver unattended installation with PowerShell - Citrix Receiver Commandline Helper.jpg

It is difficult for me to tell you exactly which command line switches (= parameters) you should use. This all depends on your environment. However, you should be aware of the following:

  • Some parameters are required to work together with server-side components, such as enabling bidirectional content redirection.
  • Some parameters require local administrator rights, such as /includeSSON to enable single sign-on authentication.
  • In some cases, a reboot may be required. For example, USB devices that are in a suspended state when Citrix Workspace app for Windows installs are not recognized by Citrix Workspace app for Windows until after the user device is restarted (reference).

Here are some of the parameters I use for my environments:

  • /silent
    All of my deployments are automated, including Citrix Workspace app. I therefore need to use the /silent parameter.
  • /includeSSON
    This enables single sign-on (pass-through authentication) so a user does not need to enter authentication information for a second time after logging on to Windows.
  • /FORCE_LAA=1
    This enables Local app Access.
  • EnableCEIP=false
    Do not enable participation in the Citrix Customer Experience Improvement Program (CEIP). CEIP collects anonymous statistics and usage information and sends them to Citrix.
  • /AutoUpdateCheck=disabled
    I personally prefer to test new versions of Citrix Workspace app before implementing them in production (so no automatic updates are allowed). You can also omit this parameter entirely and manage the auto-update behavior using Group Policy. See also the Auto-Update section in Carl Stalhood’s article Citrix Workspace app 1909.
Note: In case you are updating to Citrix Workspace app from an unsupported version, make sure to use the parameter forceinstall (this command replaces the rcu parameter used for Citrix Workspace app version before 1909). This will execute the Receiver Cleanup Utility.

The /noreboot parameter is not required for silent installations according to the Citrix documentation. If possible, I recommend rebooting the machine before using Citrix Workspace app.

Citrix Workspace app log files

The installation of Workspace app generates multiple log files: one general log file (“Trolley Express”) and one log file per MSI installation, for example:

  • TrolleyExpress-%Date%-%Time%.log
  • CtxInstall-CitrixHDXMediaStreamForFlash-ClientInstall-%Date%-%Time%.log
  • CtxInstall-DesktopViewer-%Date%-%Time%.log
  • CtxInstall-SelfServicePlugin-%Date%-%Time%.log

The total number of log files depends on the number of components you install. Each MSI log file represents one component; the more components you install, the more log files will be generated (up to a total of 12).

The installation log files generated by Citrix Workspace app are always created in the TEMP folder in the subfolder CTXReceiverInstallLogs-%Date%-%Time%. The log directory still includes the name Receiver.

Note: in the section Troubleshooting the installation in the Citrix support article Configure and install using command-line parameters it is stated that the log files are stored in the directory %TEMP%/CTXWorkspaceInstallLogs, but this seems to be an error. The directory is still the same as it was for Citrix Receiver, namely CTXReceiverInstallLogs-%Date%-%Time%.

The location of the TEMP folder in most environments is one of the following:

  • C:\Users\%UserName%\AppData\Local\Temp
    This directory is for sure used in many environments. Each user has a temporary directory.
  • C:\Users\%UserName%\AppData\Local\Temp\%SessionNumber%
    This is almost the same directory as the previous one. The difference is that each user has a temporary directory per session. If allowed by the administrator, a user can have multiple sessions on one system.
  • C:\Windows\Temp
    This is the TEMP of the local SYSTEM account. Software deployment tools such as Microsoft SCCM use the SYSTEM account for installations on the local machine.
  • C:\Temp
    This directory may be used on a FAT client. On a multi-user system, it is not typical to use one temp directory for multiple users.

Of course, the TEMP directory in your environment may be different than the ones listed above. The environment variable %TEMP% will always contain the correct location of the TEMP directory.

Unfortunately, there is no installation (or uninstallation) parameter that allows the log files to be written to another directory besides TEMP. There is no command-line switch like /Logfile or /Log.

The only way to capture the log files in a directory other than TEMP is to copy them from the TEMP folder after the installation has finished.

In the complete installation script below, the script starts by deleting any existing Citrix Workspace app log files from the TEMP directory (lines 71 to 80). By using the environment variable %TEMP% the script makes sure that the correct TEMP directory is used.
After the installation (or uninstallation), the script copies the newly created log files to the log directory declared in the variable $LogDir. The log directory ($LogDir) is a combination of the variables $BaseLogDir and $PackageName. You can change these variables in lines 45 and 46.

Updating from Receiver to Workspace app (warning)

I experienced an issue updating the last version of Citrix Receiver (4.12) to the new Workspace app version 1909 and it had to do with the HDX RealTime Media Engine.

The warning message I received was:

“You might be having an issue with a Citrix virtual driver (HDX RealTime Media Engine). Contact your system administrator for further assistance.”

Citrix Workspace App unattended installation with PowerShell - Warning issue with Citrix virtual driver HDX RealTime Media Engine

Although this is a warning message, I was not able to start any published applications.

Even reinstalling the HDX RealTime Media Engine (forcing a repair) did not work. At the end, I did the following, which worked:

  • Uninstall the HDX RealTime Media Engine
  • Uninstall Receiver
  • Reboot machine*
  • Install Workspace app
  • Install the HDX RealTime Media Engine
  • Reboot machine*

A reboot may not have been strictly necessary, but since I installed Receiver including Single Sign-On I decided to restart the machine.

Configure default device access behavior (Client Selective Trust)

As per Citrix: “With the introduction of Receiver 3.x (Workspace app) client, administrators can configure the default behavior for device access when connecting to a Citrix XenDesktop or XenApp environment. By default, the Desktop Viewer client device restrictions are based on the Internet region and this behavior can be changed by creating the Client Selective Trust feature registry keys under the HKEY_LOCAL_MACHINE hive in the registry and by modifying the required values.”

For example, when you allow the user to access files on the local client device, you may see the following security warning:

Citrix Workspace App unattended installation with PowerShell - Security Warning

The security popup can concern the following local resources:

  • Client Drives
  • Microphones and Webcams
  • USB and other Devices

The default behavior of Workspace app is to prompt the user. As an administrator, you can define the access level by modifying the registry or by using the ADMX group policy template. There are four access levels:

  • 0 = No Access
  • 1 = Read Only Access
  • 2 = Full Access
  • 3 = Prompt User for Access

Please see the Citrix article How to Configure Default Device Access Behavior of Receiver, XenDesktop and XenApp for more information.

I decided to modify the default behavior using the registry. I downloaded the ZIP file from the aforementioned article and modified the file ReceiverCSTRegUpx86.reg. I set all relevant registry entries to 2 (= Full Access) except for the Restricted Sites region/zone (these values remain on 0 = No Access).

Note:
Yes, I used the file ReceiverCSTRegUpx86.reg even though I installed Workspace app on a 64-bit operating system. On a 64-bit operating system, Workspace app installs itself in the folder C:\Program Files (x86) and all processes run in 32-bit mode.

Citrix Workspace App unattended installation with PowerShell - All Workspace App processes are 32-bit

 

 

You can download a copy of this modified file here:

Citrix Workspace app Client Selective Trust x86 Dennisspan.com.zip

In the complete installation script below, the script imports the registry file in lines 201 to 205. Please make sure that you copy the actual file to the subdirectory Files. Also, in case you rename the registry file, please make sure to change the file name in the script as well (line 204).

Please be aware that pre-configuring the Client Selective Trust settings does NOT prevent a user from changing these settings! A user can configure his or her connection preferences in the Connection Center under Preferences.

Citrix Workspace App unattended installation with PowerShell - Access Preferences

Citrix Workspace App unattended installation with PowerShell - Access Preferences - File Access

In case you want to prevent the user from changing the preferences, set the value (Default) in the following registry key to false:

HKLM\SOFTWARE\WOW6432Node\Citrix\ICA Client\Client Selective Trust\oidPredefinedSecurityPolicySettings\InstantiatedSecurityPolicyEditable

Like this:

Citrix Receiver unattended installation with PowerShell - Client Selective Trust prevent users from editing

As you can see in the screenshot below, after changing the (Default) value (REG_SZ) to false, the user is no longer able to change the preferences.

Citrix Workspace App unattended installation with PowerShell - Access Preferences - File Access - Read-Only

You do not even need to close the active session for this setting to work. You only have to close the Preferences window and open it again after changing the registry value. The change is active instantly.

The complete installation script below does NOT change the (Default) registry value. In case you would like to change it, please add the following code:

Place it somewhere between lines 199 and 266.

A big thanks to my colleague Wolfgang Thürr for bringing this to my attention.

Prevent the Add Account window from launching

In the Add Account window, as per Citrix “users can […] set up a Citrix Workspace app account by entering an email address or a server URL. Citrix Workspace app determines the NetScaler Gateway, StoreFront server, or AppController virtual appliance associated with the email address and then prompts the user to log on for enumeration.”

The Add Account wizard can be triggered in three ways:

  • At the end of the installation by clicking the Add Account button.
  • At logon time.
  • By double-clicking the Workspace app icon in the system tray.

By default, at the end of the installation, the Add Account button is shown.

Citrix Workspace App unattended installation with PowerShell - Installation successful with add account button

To prevent this button from appearing you can do one of two things:

  1. Rename the installation file CitrixWorkspaceApp.exe to CitrixWorkspaceAppWeb.exe (this name has to be exact including camel-case letters). Reference: Deploy Citrix Workspace app for Windows using Workspace for Web.
  2. Use the group policy setting EnableFTU* or create the registry item EnableX1FTU in the registry key HKLM\SOFTWARE\Wow6432Node\Policies\Citrix with a DWORD value of 0 before running the installation.

*You can now configure the EnableFTU setting using a Citrix Workspace app group policy. See the section below on the Workspace app ADMX files. This group policy setting sets the following two registry values:

  • HKLM\SOFTWARE\Policies\Citrix -> EnableX1FTU -> DWORD 1
  • HKLM\SOFTWARE\Wow6432Node\Policies\Citrix -> EnableX1FTU -> DWORD 1

Citrix Workspace App unattended installation with PowerShell - EnableFTU included in ADMX file

The result is that the Add Account button is not shown.

Citrix Workspace App unattended installation with PowerShell - Installation successful without add account button

In the complete installation script below, the registry item EnableX1FTU is created before installation, although strictly speaking it is not necessary since the PowerShell script triggers a silent installation (so no GUI is shown anyway).

By default, the Add Account window is also triggered at user logon.

Citrix Workspace App unattended installation with PowerShell - Add account popup window at logon

To prevent this window from appearing, there are three options:

  1. Add the registry item HideAddAccountOnRestart (DWORD) with a value of 1 to the registry key HKCU\Software\Citrix\Receiver (yes, the old name Receiver is still used). The tick box “Do not show this window automatically at logon” creates the same registry entry. Please be aware that this is a current user setting. I therefore recommend using a Group Policy Preference (the article Configuring the time zone and code page with Group Policy demonstrates how to configure Group Policy Preferences).
  2. Set the value of the registry item AllowAddStore (REG_SZ) to N in the registry key HKLM\SOFTWARE\WOW6432Node\Citrix\Dazzle. You can also control this setting using a Group Policy.
  3. Rename the installation file CitrixWorkspaceApp.exe to CitrixWorkspaceAppWeb.exe (this name has to be exact including camel-case letters).

The complete installation script does not prevent the Add Account window from appearing at user logon. In case you want to prevent this from happening and you do not want to configure a Group Policy Preference, simply rename the file CitrixWorkspaceApp.exe to CitrixWorkspaceAppWeb.exe as mentioned previously (this is the simplest solution).

Note: renaming the CitrixWorkspaceApp.exe means that e-mail-based account discovery is no longer supported (reference: Deploy Citrix Receiver for Windows from Receiver for Web).  Also, see the official Citrix article How to Suppress the Add Account Window in Citrix Receiver for Windows for more information.

Prevent an unexpected MSI repair from launching

It may happen that when you try to start a published application, an MSI installer repair of the component “Citrix Online Plug-in” is started.

Citrix Workspace App unattended installation with PowerShell - Unexpected MSI repair

The exact cause for this behavior is unknown to me, but I can offer you a workaround. To solve this issue, you simply have to delete all data from the registry value WEB_CLIENT (part of the Citrix Online Plug-in MSI). Do not delete the registry value itself! Just remove the data from it (“empty” it) as shown in the screenshot below.

Citrix Workspace App unattended installation with PowerShell - Unexpected MSI repair - WEB_CLIENT registry value

The registry value WEB_CLIENT (string / REG_SZ) is located here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\%ProductGUID%\Features

The product GUID is different for each version of Citrix Workspace app:

  • D40311B1F8DD0004B8715A85DAECC4CF -> Workspace app version 1808
  • 65DDBF745D30EBA42B298EB9F8EF598B -> Workspace app version 1809
  • 230369BA6C7C7464683823509A70DF6E -> Workspace app version 1810
  • 691BFE598F3E06243B378CC91B536771 -> Workspace app version 1812
  • 52593DD2E7A97DE41BF6EED7F1579FA5 -> Workspace app version 1902
  • 9BBCC4F9C00B64B4990698B41BB1A3AF -> Workspace app version 1903
  • 88759762CEE8CF04C85B2D3727441362 -> Workspace app version 1904
  • D2C5650F878893E40B9B9562ED9373CA -> Workspace app version 1904.1
  • 6A325AD5754E1B044A29EBB5065A2C67 -> Workspace app version 1905
  • 195324F90296A2B46A9766A17E548F7D -> Workspace app version 1907
  • ACD95015F191DC94A873EF5561AE259C -> Workspace app version 1909

In the complete installation script below, the data in the WEB_CLIENT registry value for Citrix Workspace app 1909 is removed (lines 209 to 225).

Prevent the splash screen “Citrix Receiver is now Citrix Workspace App” from showing

When a user opens Citrix Workspace app for the first time, the splash screen “Citrix Receiver is now Citrix Workspace App” is shown:

Citrix Workspace App unattended installation with PowerShell - Splash screen

The following registry value prevents the splash screen from appearing:

  • Key: HKEY_CURRENT_USER\Software\Citrix\Splashscreen
  • Value name (REG_SZ / string): SplashscreenShown
  • Value: 1

Citrix Workspace App unattended installation with PowerShell - Prevent splash screen from showing registry value

This value is not included in the complete installation script below. I recommend using a Group Policy Preference to configure this setting (the article Configuring the time zone and code page with Group Policy demonstrates how to configure Group Policy Preferences).

 

 

Remove Citrix Workspace app shortcuts

During installation, Citrix Workspace app creates a shortcut in the Programs folder in the Start Menu of the public user (= All Users):

C:\ProgramData\Start Menu\Programs\Citrix Workspace.lnk

In the complete installation script below, this shortcut is removed (lines 261 to 264).

Note:
In the past, Citrix Receiver (now Workspace app) created a shortcut in the public Programs\Startup folder in the Start Menu (= All Users). This is no longer the case, but the installation script does check for this value and removes it in case it exists.
Citrix Workspace app automatically starts at logon time by running the command “C:\Program Files (x86)\Citrix\ICA Client\concentr.exe” /startup (HKLM\SOFTWARE\WOW6432Node\Microsoft\ Windows\CurrentVersion\Run -> ConnectionCenter).

Prevent Windows 10 Game Bar popup (Win+G)

As per Citrix: “When launching published apps or desktops from a Windows 10 OS a […] popup windows briefly appears prompting to press Win + G for the game bar or the search bar.”

Citrix Receiver unattended installation with PowerShell - Citrix Receiver Game Bar Win+G

As described in the article, you can disable the game bar with the following registry entry:

  • Key: HKLM\SOFTWARE\Policies\Microsoft\Windows\GameDVR
  • Item: AllowGameDVR
  • Value: 00000000
  • Type: DWORD

The complete installation script below sets this registry value (line 237).

Modify the Network Provider order (for Windows 10 1709 only)

When you install the Workspace app Single Sign-on feature (/includeSSON), an entry is created in the network provider order.

What is the network provider order?
Using network providers, Windows can support many different types of network protocols without having to know the network-specific details of each network (reference). By default, Windows ships with the following three network providers in the following order:

  • Microsoft Remote Desktop Session Host Server Network Provider (RDPNP)
  • Microsoft Windows Network (LanmanWorkstation)
  • Web Client Network (webclient)

In the registry, the list and order of the Microsoft and third-party network providers can be found here: HKLM\System\CurrentControlSet\ Control\NetworkProvider.

The network provider settings can also be viewed/managed using the GUI:
Start -> Network Connections -> Change Adapter options -> Advanced (menu) -> Advanced Settings

Citrix Receiver unattended installation with PowerShell - Windows Network Providers

Citrix adds the entry PnSson (= Citrix Single Sign-on). Citrix recommends that this entry be listed as number four, after the three default Windows network providers (see the info box above).

With Windows 10 version 1709, two things are important to know:

  1. There is a known bug with the network provider
  2. The network provider order is handled differently compared to older operating systems

Let’s start with the bug. As described by Citrix in the article Windows 10 Fall Creators Update (v1709) – Citrix Known Issues, the network provider has a bug (which is fixed in Windows 10 version 1803 and higher). The bug is that no third-party network provider, including Citrix’s PnSson value, is populated under the newly introduced registry key ProviderOrder under HKLM\System\ CurrentControlSet\Control\NetworkProvider. This bug causes the error “failed to get network providers” when you try to display the network provider order graphically.

Citrix Receiver unattended installation with PowerShell - Failed to get network providers

Please be aware that the actual functionality of the network provider still works.

In the past, the order of the network provider was determined by the order of the entries in the registry item ProviderOrder under HKLM\System\CurrentControlSet\Control\NetworkProvider\Order. With Windows 10, this is no longer the case. The order is now determined by the decimal value of the network provider (HKLM\System\CurrentControlSet\Control\NetworkProvider\ProviderOrder). The item with the lowest number is executed first and the item with the highest number last.

Citrix Receiver unattended installation with PowerShell - Windows Network Providers order

In the article Windows 10 Fall Creators Update (v1709) – Citrix Known Issues, Citrix recommends creating the missing item using the decimal DWORD value of 4000. I recommend using a different number, for example, 3001 or 3500. The reason for this is simple; you may have another third-party product that already occupies the number 4000. This is for example the case when you install a product such as Lotus Notes including the Notes Single logon service. The main goal is that the PnSson value is listed as the fourth item, after the three default Microsoft ones. The third Microsoft entry has a value of 3000, so the value PnSson needs to have a higher value (at least 3001 or higher).

In the complete installation script below, the missing network provider registry item is created in lines 241 to 251, but only for Windows 10 version 1709.

Performance optimizations

There seem to be a couple of registry values that may improve the performance of Workspace app. I did not add these to the complete installation script. In case you experience slow enumerations of (start menu) icons, please test the following registry values:

See the example in the previous section on how to add these values to the complete installation script.

Complete installation script

I packed the complete Citrix Workspace app installation in my installation template. The script below contains the installation and all configurations for Citrix Workspace app as described in the previous sections, including detailed logging and error handling. The functions used in the scripts require my PowerShell Functions Library to be present on the local system. This means that before you can use the script, you need to copy the PowerShell module file DS_PowerShell_Function_Library.psm1 to the local system first.

The script was created for Windows 10 (all versions) and Windows Server 2016 version 1607 and higher. I tested this script on Windows 10 version 1803.

To use this script, please follow these steps:

  • Create an installation directory on the local computer or a file share (UNC path). For example C:\Temp\Citrix\WorkspaceApp.
  • Create a subdirectory called Files.
  • Download and copy the Workspace app CitrixWorkspaceApp.exe to the folder Files in the installation directory.
  • Optional: rename the CitrixWorkspaceApp.exe to CitrixWorkspaceAppWeb.exe.
  • Download and copy the registry file (*.reg) containing the Client Selective Trust registry keys and values to the folder Files in the installation directory.
  • Download and copy the PowerShell module file DS_PowerShell_Function_Library.psm1 to a directory on your local system.
  • Copy the complete PowerShell script below to a new PS1 file (e.g. Install_CitrixWorkspaceApp.ps1) and add this file to the root of the installation directory (not in the subdirectory Files).
  • Modify the PowerShell script:
    • Optional: modify the location of the log directory and log file name in lines 45 and 46.
    • Optional: in case you renamed the CitrixWorkspaceApp.exe to CitrixWorkspaceAppWeb.exe, enter the correct file name in line 100.
    • Optional: in case you use a different sub-directory name instead of Files, change it in line 106.
    • Enter the correct path to the PowerShell module file in line 62.
    • Enter the correct product ID of the version of the Workspace app you are installing in line 223. You find all product IDs in the comments above line 223 as well as in this section of this article.
  • Execute the PowerShell script as follows:
    powershell.exe -executionpolicy bypass -file C:\Temp\Citrix\WorkspaceApp\Install_CitrixWorkspaceApp.ps1

To uninstall Workspace app, execute the script as follows:

powershell.exe -executionpolicy bypass -file C:\Temp\Citrix\WorkspaceApp\Install_CitrixWorkspaceApp.ps1 Uninstall

The uninstallation removes any custom configuration the installation may have set as well as the following two registry keys:

  • HKLM\Software\Policies\Citrix\ICA Client
  • HKLM\Software\Wow6432Node\Policies\Citrix\ICA Client

Removing these two registry keys is recommended by Citrix in the section To uninstall Citrix Workspace app for Windows using the command line interface in the article Install and uninstall Citrix Workspace app for Windows manually.

If you want to go one step further and create an SCCM package as well, please follow the step-by-step explanation in the article Deep dive creating SCCM packages for Citrix.

Conclusion

Installing and configuring Citrix Workspace app can get quite complicated and requires a bit of planning. Also, please be aware of the following:

  • More settings can be directly configured during the installation of Citrix Workspace app. Most of these configurations concern the Windows registry. Please see the section Registry Values in Carl Stalhood’s article Citrix Workspace app 1909 for more information. In case you want to add additional configurations to the complete installation script, I recommend copying and reusing existing lines of code. Please be aware that many settings can nowadays be managed using Group Policy.
  • Citrix Workspace app comes with a large collection of Group Policy settings. Please see the section Workspace app / Receiver Group Policy ADMX Template in Carl Stalhood’s article Citrix Workspace app 1909 for more information. The actual ADMX files can be downloaded on the Citrix website (in the section Downloads for admins), but they are also included in the installation directory of Workspace app (C:\Program Files (x86)\Citrix\ICA Client\Configuration).
  • Pass-through authentication (or single sign-on) requires many different settings to be correctly configured, such as Trusted Sites, Trust XML Requests on the Delivery Controller, installing the Single Sign-On component in Workspace app, and more. Please see the section Pass-through Authentication in Carl Stalhood’s article Citrix Workspace app 1909 for a complete overview of what needs to be configured. Citrix Workspace app comes with a built-in tool for checking the SSON configuration (see the Citrix article SSON Configuration Checker for Citrix Receiver for Windows for more information).
    Citrix Workspace App unattended installation with PowerShell - Advanced Preferences - Config CheckerCitrix Workspace App unattended installation with PowerShell - Citrix Configuration Checker
  • The latest version of Workspace app is also included in the installation sources of the Virtual Delivery Agent. On a Citrix worker, there are two possible strategies you can follow:
    1. You install Workspace app as a stand-alone installation (as described in this article) and install the Virtual Delivery Agent excluding Workspace app. This is accomplished by using the command line /components VDA as described in the section Citrix Virtual Delivery Agent in my article Scripting the complete list of Citrix components with PowerShell.
    2. You install the version of Workspace app included in the Virtual Delivery Agent installation sources (in this case you do the parameter /components VDA,PLUGINS). In this case, you do NOT install Workspace app as a stand-alone installation.
  • When using Skype for Business in your environment, you may want to install the HDX RealTime Media Engine on your client device together with Citrix Workspace app. Citrix Workspace app is a prerequisite for the Media Engine; without Workspace app, Media Engine cannot be installed. To automate the installation of the HDX RealTime Media Engine, please see the section HDX RealTime Media Engine for Windows in my article Scripting the complete list of Citrix components with PowerShell. Also, for extensive information on Skype for Business, Citrix, and the HDX RealTime Optimization Pack, please see the section Skype for Business in Carl Stalhood’s article Citrix Workspace app 1909. I also highly recommend you to read the article Skype for Business with XenApp & XenDesktop written by Citrix CTP George Spiers.
  • Citrix Workspace app 1809 and higher supports Citrix Screen Casting for the Citrix Ready workspace hub.
    Citrix Workspace App unattended installation with PowerShell - Advanced Preferences - Citrix Casting

I hope the information in this article was of some help to you. Happy scripting!

50 thoughts on “Citrix Workspace app unattended installation with PowerShell

  1. Pingback: Detailed Change Log – Carl Stalhood

  2. I felt I had to let you know, thanks so much for this mate. Saved me a heap of pain getting this ready to deploy!
    Cheers
    Dean

    • Well thank you very much for your very kind words Dean! Feedback such as yours is the currency of bloggers such as myself! 🙂 I am happy to have been of some help. Enjoy your day mate!

  3. Hi , thanks for a great work.
    I get it to work with the install and uninstall, i wanna add-in the url to the Storefront server.
    On Line 99 $Arguments i tried to add STORE0=SITENAME;https://servername/iis-webpath/
    After i have install receiver with this i get error that site cant be found.

  4. Pingback: Receiver / Workspace app 1810 – Carl Stalhood

  5. Any suggestions on how to get the app shortcuts to show up on the Start Menu upon deployment? Right now, it seems like even with SSO enable upon deployment, the Workspace app needs to be launched once and logged in (via SSO) before pulling down all the app shortcuts a user is permissioned for. Ideally, this should happen upon log on automatically as was the case for receiver.

    Thanks in advance.

  6. Hello Dennis. Thank you for such a nice article. I have a question.

    – I have installed Citrix Workspace App. And have connected to citrix server by giving server address, username and password.
    – Now I want that on startup it should read all three things server address, username and password from a file and it shoul be auto filled.

    I hope that I have explained it well.

    • Hi Asad,

      Thanks for your kind feedback. I am not sure I understand your question correctly. How exactly do you logon to the server? Through the web browser or do you connect directly using a store? Do you use pass-through authentication?

  7. Hi. Thanks again for a great work with this script, have saved me hours of hands on time.
    On line 100 our syntax looks like this.
    $Arguments = “/silent /includeSSON STORE0=””STORE1;https://sfbaseurl/IIS/discovery;on“” /FORCE_LAA=1 EnableCEIP=false /AutoUpdateCheck=disabled”

    As u can see we have to put in double “” in the store url to get this to work, but after the installation of workspace client it have double storefront url to same Store, client work but how to get rid of the double account in the client?

  8. I’m testing the script with the actual WorkspaceApp 1907.

    The script starts and “hangs” on “start installation”.

    the workspace app is installed although, but I have to cancel the script.

    the same problem I have with workspace app 1904.

  9. Hi Dennis,

    Just wondering if you ever found a solution for the below? I am having the same issue when trying to switch our Citrix environment from Receiver to Workspace App.

    “Any suggestions on how to get the app shortcuts to show up on the Start Menu upon deployment? Right now, it seems like even with SSO enable upon deployment, the Workspace app needs to be launched once and logged in (via SSO) before pulling down all the app shortcuts a user is permissioned for. Ideally, this should happen upon log on automatically as was the case for receiver.

    Thanks in advance.

    Reply ↓

    Dennis Span
    on April 2, 2019 at 08:59 said:
    Hi Wai,

    I do not have an answer for you right this moment. I will test it and get back to you.”

    • Hi David,

      I did some testing on this matter and was not able to reproduce the matter, unless I had subscriptions enabled. So the first question to you would be; did you set the StoreFront store setting “Manage User Subscriptions” to “Disable User Subscriptions (Mandatory Store)”? Furthermore, which version of Citrix Workspace app are you using and to which Citrix infrastructure are you connecting (Xenapp 6.5, XenDesktop xx, Citrix Virtual Apps and Desktop?).

  10. Pingback: Site Updates – September 2018 – Carl Stalhood

  11. Awesome script can’t wait to try. We have the client in a Non-Persistent Environment and also needed to add the FW Rule for the workspace client… Else users with no admin rights will get prompted to accept the FW rule.

    New-NetfirewallRule -DisplayName “Citrix HDX Engine” -Profile Any -Direction Outbound -Action Allow -Program “C:\Program Files (x86)\Citrix\ICA Client\wfica32.exe”

  12. Hello Dennis, we test the script with the actual WorkspaceApp 1911. The App is installed, but the script hangs on the installation step

  13. Hi, I hope you’re ok
    The scenario is as follows, I deploy a VDI virtual desktop Windows 10, in the VDI Citrix Worskpace is installed, from the VDI I deploy applications via XenApp, but in the VDI desktop the shortcut of the VDI Windows 10 is shown.
    How can I remove the shortcut from the VDI?

  14. Hello,
    I hope you are well.I have a question, can you also reset the workspace app via powershell. since I’m not yet so fit in powershell I ask for

  15. Great information , thanks for sharing !

    I will deploy a Virtual Lab , with 2 VDI with XenApp, and Xendesktop, a Delivery Controller , and a Storefront, maybe a shared cluster with SQL DB and a Licence server, to test all Scripts from Carl Webster , XA, DX , etc . whats best scenario or deployment recommendation you would like to give me before starting ?

    • Hi Pablo. I am sorry, but your question is pretty general. What kind of recommendations are you looking for? Which version to use? LTSR versus CR? On-Prem or public cloud? Automated installation or manual?

  16. I also have a question to which you may have additional insight:

    I get the following in the installation logs:

    16:13:18: Information – CProcess_Execution_help::Execute_ReceiverEXE(770) – Executing command : C:\Program Files (x86)\Citrix\ICA Client\Receiver\receiver.exe -noshowconfigurationwizard
    16:13:18: Error – CProcess_Execution_help::Execute_ReceiverEXE(775) – Unable to start process.
    16:13:18: Information – CProcess_Execution_help::Execute_RedirectorEXE(512) – Executing command : “C:\Program Files (x86)\Citrix\ICA Client\redirector.exe” /regserver
    16:13:19: Information – CProcess_Execution_help::Execute_RedirectorEXE(528) – Executing command : “C:\Program Files (x86)\Citrix\ICA Client\redirector.exe” /startup
    16:13:19: Error – CProcess_Execution_help::Execute_RedirectorEXE(533) – Unable to start process.Return code=5
    16:13:19: Information – CProcess_Execution_help::Execute_ConcentrEXE(727) – Executing command : C:\Program Files (x86)\Citrix\ICA Client\concentr.exe /startup
    16:13:19: Error – CProcess_Execution_help::Execute_ConcentrEXE(732) – Unable to start process.
    16:13:19: Information – CProcess_Execution_help::Execute_SelfServiceEXE(602) – Executing command : C:\Program Files (x86)\Citrix\ICA Client\SelfServicePlugin\SelfService.exe -cleanPNA -exit
    16:13:19: Error – CProcess_Execution_help::Execute_SelfServiceEXE(607) – Unable to start process.
    16:13:19: Information – CProcess_Execution_help::Execute_SelfServicePluginEXE(677) – Executing command : C:\Program Files (x86)\Citrix\ICA Client\SelfServicePlugin\SelfServicePlugin.exe
    16:13:19: Error – CProcess_Execution_help::Execute_SelfServicePluginEXE(682) – Unable to start process.

    This results in error messages popping up, and occurs when installing as Local System instead of with a user context. The installation still succeeds, but I’m trying to figure out why this happens and if it’s possible to prevent.

    • Hi Matthew,

      What does the error message say? Can you send me your exact installation syntax? Does the error message appear on multiple machines? Is an existing Receiver or Workspace app installed on these machines?

      • The title bar of the error message says, “Receiver.exe – Application Error”. The content: “The application was unable to start correctly (0xc0000142). Click OK to close the application.”

        This is the command that I’m using:

        $t = Start-Process -FilePath C:\temp\Citrix_ePad\CitrixWorkspaceAppWeb.exe -ArgumentList ‘/silent /AutoUpdateCheck=disabled’ -PassThru -ErrorAction Stop
        if($t -ne $null)
        {
        Wait-Process -InputObject $t
        }

        Part of the reason I’m using that command is due to this article, which actually makes a mention of this issue: https://support.citrix.com/article/CTX257546

        I’m also seeking to suppress auto updates, the request for email, and security prompts (I have the .reg file being imported after installation). Everything seems to work except for the error messages I’m receiving.

        This only results in the error when deploying using automation policy; that is, if I run the command in a user-context with an elevated PowerShell instance, then I won’t see the error. I get the error when running automation policy as Local System/non-user context. I’ve had to log the end-users out as part of the automation policy for other reasons, and as long as no one is logged in then obviously the error doesn’t show. It will show if the end-user logs in during the installation. This happens on multiple machines.

        There is an existing installation on these machines at the time the automation policy starts; however, Citrix Receiver/Workspace is uninstalled before the installation is performed. I can also try this on a machine that doesn’t have it previously installed.

        Based on my understanding of the issue, this issue may be resolved by simply suppressing the commands to start these processes as part of the installation. It just doesn’t seem to be an option.

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.