Change a RemoteApp Program icon in Windows 2012 R2 RD Web Access


As I was doing Step by Step Windows 2012 R2 Remote Desktop Services – Part 4, which is all about publishing RemoteApp programs I figured I’d put this in a separate post.

Can we change the icon for a Published RemoteApp? Yes we can.

Open an administrative Powershell prompt and type the following command:

Get-RDRemoteApp -alias "notepad" | fl

This will show all properties for the RemoteApp with “notepad” as alias:

CollectionName      : RemoteApps
Alias               : notepad
DisplayName         : Windows Update Log
FolderName          : Logfiles
FilePath            : C:\Windows\System32\notepad.exe
FileVirtualPath     : C:\Windows\System32\notepad.exe
CommandLineSetting  : Require
RequiredCommandLine : c:\windows\windowsupdate.log
IconContents        : {0, 0, 1, 0...}
IconIndex           : 0
IconPath            : C:\Windows\System32\notepad.exe
UserGroups          :
ShowInWebAccess     : True

So, looking at these properties we are able to change the icon here! This isn’t possible in the UI.

There are 2 properties to manipulate the icon:

IconIndex:          the index for the icon you wish to show (0 if only 1 icon is available)
IconPath:           the container holding the icon(s)

The IconPath setting can point to a .exe, a .ico, or a .dll file.

Let’s change the icon to an icon from shell32.dll. Why? Because I know for sure this file is available on all Windows installations.

Create a dummy shortcut or select an existing one. Change the icon and browse to c:\windows\system32. Select shell32.dll and select the Windows Update icon.

Custom Icons in published RemoteApp Programs 01
The IconIndex for this interface works top to bottom, starting with 0. So count the rows until you see your desired icon, multiply this by 4, subtract 1, and count up to your desired icon. The IconIndex for the Windows Update icon turns out to be 46.

Type one of the following commands in the Powershell box:

Get-RDRemoteApp -Alias "notepad" | Set-RDRemoteApp -IconPath "c:\windows\system32\shell32.dll" -IconIndex 46

or

Set-RDRemoteApp -CollectionName "RemoteApps" -Alias "notepad" -IconPath "c:\windows\system32\shell32.dll" -IconIndex 46

Now reload the RD Web Access:
Custom Icons in published RemoteApp Programs 02
And there you have it: Custom icons on RemoteApp programs.

Update:
As Chris Bigg says in the comments, if you have a .ico file there’s no need to use powershell to change the icon.
Browse to %WINDIR%\RemotePackages\CPubFarms\CPubRemoteApps on the server holding the RD Connection Broker role and you will see all the .ico files. In the example for Windows Update Log I’d remove “notepad.ico” and instead copy a .ico file of my choice and rename it to “notepad.ico”.
This will replace the icon for the RemoteApp in your Remote Apps and Desktop Connections application on next refresh. For RD Web Access you’ll have to stop and start the Web application on the RD Web Access server.
This will only work for .ico files. If your icon is in a .exe or .dll you’ll still have to use powershell.

Arjan

20+ years experience in Microsoft powered environments. Enjoy automating stuff using scripts, powershell, and even batch files. In my free time (hah! as if there is any) I hunt achievements and gamerscore on anything Xbox Live enabled (Windows Mobile, Windows 8, Windows 10, Xbox 360 and Xbox One). When I'm not doing that I enjoy traveling or riding my Yamaha R1 on the edge ;)

Tagged with: , ,
Posted in Remote Desktop, Windows 2012 R2
9 comments on “Change a RemoteApp Program icon in Windows 2012 R2 RD Web Access
  1. Chris Bigg says:

    C:\Windows\RemotePackages\CPubFarms\\CPubRemoteApps on the broker.

    Change the icon file to what you want it to.

  2. Zathri says:

    In 2012 R2, -IconPath does not appear to be a parameter in Get-RDRemoteApp command

  3. Stanley K says:

    Thanks for this post, very helpful. The icon updated in RDWeb in my instance, however the RemoteApp in the taskbar still uses the program’s icon. Is there a way to set the taskbar icon to be the same?

  4. Thanks for this. Really helped.

  5. steve Salmon says:

    Hello,

    Thanks for the instructions, this did work for me although I received an error when running the first command. It stated that there was no Remote Desktop Services Deployment when running from the App or GW servers.

    Turns out as we have two connection brokers I had to select the active broker in order for the commands to run correctly.

    http://www.srs-net.co.uk/rds2012-deployerr/

  6. Zack says:

    Thanks for posting this. I did have to add the ‘-ConnectionBroker’ switch to get it to run correctly as well. I thought this was odd as we have a very simple two server setup with only one connection broker.

    Now if only I could find a way to force remoteapp clients to update their icon.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog Authors
Donate Button

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 322 other followers

Blog Stats
  • 1,913,769 hits
%d bloggers like this: