How to Hide Applications in StoreFront 2.5

How to Hide Applications in StoreFront 2.5

book

Article ID: CTX204869

calendar_today

Updated On:

Description

This article describes how to configure StoreFront resource filter to hide certain resources by type or keyword.


Instructions

A popular customization of Web Interface is to hide certain resources (applications, desktops or documents) from users. StoreFront 2.5 provides a resource filter to support this out of the box. Resources can be filtered by type or keyword.  The filter you set up for a Store will work for both the Receiver for Web and native receivers (for example, Receiver for Windows).
Before running the cmdlets in the following sections, you must import the necessary PowerShell modules. Use the following snippet to import:

$dsInstallProp = Get-ItemProperty `
-Path HKLM:\SOFTWARE\Citrix\DeliveryServicesManagement -Name InstallDir
$dsInstallDir = $dsInstallProp.InstallDir
& $dsInstallDir\..\Scripts\ImportModules.ps1 

Filtering by Type

To hide resources by type, the PowerShell command Set-DSResourceFilterType can be used. The syntax is:
Set-DSResourceFilterType [-SiteId] <Int64> [-VirtualPath] <String> `
 [-IncludeTypes] <Object>

This will set up an inclusive resource filter for a specific store. 
  • SiteId is the IIS site ID, which is normally 1.
  • VirtualPath is the virtual path of the Store Service, which normally is /Citrix/Store. 
  • IncludeTypes is an array of strings representing the types of resources (Applications, Desktops or Documents) to be included.
For example, if you want to show only applications for a store in /Citrix/Store, the following command configures the store appropriately:
Set-DSResourceFilterType -SiteId 1 -VirtualPath "/Citrix/Store" `
 -IncludeTypes @("Applications")

The PowerShell command Get-DSResourceFilterType can be used to examine the filter you have set up. The syntax is:
Get-DSResourceFilterType [-SiteId] <Int64> [-VirtualPath] <String>

Filtering by Keyword

To hide resources by keyword, the PowerShell command Set-DSResourceFilterKeyword can be used to set up an inclusive or exclusive filter. The syntax is:
Set-DSResourceFilterKeyword -SiteId <Int64> -VirtualPath <String> `
 -IncludeKeywords <Object>

-Or-
Set-DSResourceFilterKeyword -SiteId <Int64> -VirtualPath <String> `
 -ExcludeKeywords <Object>

For example, if you want to configure Store1 at /Citrix/Store1 to only show resources with keywordForStore1, the following command will configure the store to do that:
Set-DSResourceFilterKeyword -SiteId 1 -VirtualPath "/Citrix/Store1" `
 -IncludeKeywords @("ForStore1")

If you want to configure Store1 at /Citrix/Store1 to not show any resources with keywordHiddenFromStore1, the following command will configure the store:
Set-DSResourceFilterKeyword -SiteId 1 -VirtualPath "/Citrix/Store1" `
-ExcludeKeywords @("HiddenFromStore1")

The PowerShell command Get-DSResourceFilterKeyword can be used to examine the filter you have set up. The syntax is:
Get-DSResourceFilterKeyword [-SiteId] <Int64> [-VirtualPath] <String>

Environment

The above mentioned sample code is provided to you as is with no representations, warranties or conditions of any kind. You may use, modify and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that (a) the sample code may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the sample code fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the sample code. In no event should the code be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SAMPLE CODE, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Although the copyright in the code belongs to Citrix, any distribution of the sample code should include only your own standard copyright attribution, and not that of Citrix. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the sample code.

Issue/Introduction

This article describes how to hide apps and desktops in StoreFront while keeping them published.