Set Custom Icons on Published Desktops

Set Custom Icons on Published Desktops

A detailed blogpost on how to create and set custom icons on published desktops.

Have you ever wondered how to set custom icons on published desktops?

Questions from customers

Every once in a while, you get a question from a customer, where the answer isn’t apparent right away. This question was one of them:

Can we change the default icon, to a custom created, for Published Desktops? and keep in mind, we have several published desktops in the site.

TL:DR Yes, it’s possible.
The following article shows how to create and import/use custom icons

Default published desktop icon

As per default, published desktop icons will always be shown from C:\inetpub\wwwroot\Citrix\StoreName\App_Data\Desktop.ico from Storefront.
Citrix has made it possible to change that with a simple Powershell cmdlet, executed from a Storefront server:

& 'C:\Program Files\Citrix\Receiver StoreFront\Scripts\ImportModules.ps1'
Disable-DSStoreSubstituteDesktopImage -SiteId 1 -VirtualPath /Citrix/StoreName

If executed, icons will be shown from the default IconUid from the Delivery Group, in your Citrix site.
Say hello to the good old PNAgent icon: Full-width image

Different ways to import icons

Set icons from applications

The following needs to executed from a delivery controller, or from where Citrix snapins are installed:

$ctxIcon = Get-BrokerIcon -FileName C:\Windows\System32\notepad.exe -index 0
$brokerIcon = New-BrokerIcon -EncodedIconData $ctxIcon.EncodedIconData
$desktopGroup = Get-BrokerDesktopGroup -Name 'MyDesktopGroup'
Set-BrokerDesktopGroup $desktopGroup -IconUid $brokerIcon.Uid

Output of $ctxIcon, shows IconFormats and EncodedIconData. EncodedIconData is Base64 encoded version of the icon: Full-width image

$brokerIcon creates a new icon, with the EncodedIconData from $ctxIcon, and also gives it an Uid.
Set-BrokerDesktopGroup changes the default IconUid from 1, to the Uid from $brokerIcon.Uid.
The published desktop icon for “MyDesktopGroup” will now be displayed as the notepad icon.

Convert images to icons

icoconverter.com is the go-to site, where it’s possible change .png, .jpg, and so on to a .ico file Full-width image

Upload an image file, and it’ll do magic, and download afterwards as favicon.ico:

Get-CtxIcon -filename favicon.ico | New-BrokerIcon
Get-BrokerIcon | select Uid, EncodedIconData
Get-BrokerDesktopGroup "Delivery Group Name" | Set-BrokerDesktopGroup -IconUid "Identifier"

Get-BrokerIcon shows a combination of Uids and EncodedIconDatas. The first is always the default published desktop icon, and the following represents published application icons.
The last on the list, will be the one imported from New-BrokerIcon: Full-width image Get-BrokerDesktopGroup “Delivery Group Name” | Set-BrokerDesktopGroup -IconUid “Identifier” changes the default IconUid 1 to the number stated in “Identifier”.

Conclusion

Citrix please change the way icons for published desktop is changed. If it’s possible to change published application icons, from both Studio and Web Studio, then it should be possible to change published desktop icons.