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

25+ years experience in Microsoft powered environments. Enjoy automating stuff using powershell. In my free time (hah! as if there is any) I used to hunt achievements and gamerscore on anything Xbox Live enabled (Windows Mobile, Windows 8, Windows 10, Xbox 360 and Xbox One). Recently I picked up my Lego addiction again.

Tagged with: , ,
Posted in Remote Desktop, Windows 2012 R2
16 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.

    • Arjan Mensch says:

      Thanks for that tip Chris, I updated the post.

      • wolfski says:

        Have noticed problems with manually populating the folder with ico files, they don’t always apply immediately via this method and can persist for end users as the previous icon for an indeterminate period of time… far cleaner to use the PS cmdlet to set it up… especially if you have HA RDWeb front end servers….. it seems to apply instantly this way and clients see the new icons on next login/refresh.

      • Saj says:

        Hi Arjan,

        Thanks a lot for your posts and details. I would like to be able to know how many people are accessing a specific published Application via powershell? Is this possible please?

  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.

  7. CarlosSoto says:

    Hello Arjan
    I liked you blog very much. You have very useful and interesting articles.
    I would like to know if it is possible to change the icon and the RADC screen that is installed by default on the clients?

    https://inycom-my.sharepoint.com/personal/018_inycom_es/_layouts/15/guestaccess.aspx?docid=1d53e689c6a7246ca90e7682884d49cc0&authkey=AXsVG5iNCGsvUoKPK5Q7sAw

    thanks in advance,

    Carlos

  8. Rick says:

    I’m utterly astonished at some of the regressions in the UI since 2008R2. Why they took something like this out of the UI, and some other things too (like being able to change the FQDN without using an obscure script!), is beyond comprehension.

  9. Bernhard Diener says:

    Arjan wrote “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.” – that is an unneeded limitation, since it does not even have to be present on all windows installations but only on the remote desktop server(s). So you can point it to any .ico file you like that resides somewhere on the TS itself and don’t have to use index numbers.

  10. ryan says:

    I wrote a little ps script:

    Add-Type -AssemblyName System.Windows.Forms
    $Hostname = hostname
    $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
    InitialDirectory = “C:\Tools\RDS”
    Filter = ‘Icons (*.ico)|*.ico|All Files|*’
    }

    Function Get-GridView ($List, $Title) { # $Title = “Test”; $List = $MasterReport | Select-Object -First 10

    $Title = “$($Hostname + “: ” + $Title)”

    Write-Host $Title -ForegroundColor Cyan
    [PSObject[]]$AppToUpdate = @()
    $AppToUpdate = $List | Out-GridView -PassThru -Title $Title
    If ($AppToUpdate -ne $NULL) {
    Return $AppToUpdate
    } Else {Return}

    }

    Function Get-IconPath {

    $Result = $FileBrowser.ShowDialog()
    If ($Result -eq [System.Windows.Forms.DialogResult]::OK) {

    $FileBrowser.FileName

    } Else {Return “No”}

    }

    Function Prompt-Choice ($MSG, $Q, $Type) {
    If (!$Type) {$Type = ‘Question’; $Pmpt = ‘YesNo’}
    ElseIf ($Type -eq ‘E’) {$Type = ‘Error’; $Pmpt = ‘Ok’}
    ElseIf ($Type -eq ‘W’) {$Type = ‘Warning’; $Pmpt = ‘Ok’}

    $MsgBoxInput = [System.Windows.MessageBox]::Show($Q,$MSG,$Pmpt,$Type)
    Switch ($msgBoxInput) {
    ‘Yes’ {Return “Yes”}
    ‘No’ {Return “No”}
    ‘Cancel’ {Return “No”}
    }
    }

    $RDApps = Get-RDRemoteApp
    $SelectedApp = Get-GridView $RDApps “Select App to Assign Icon”
    If ($SelectedApp -ne $NULL) {
    $IconPath = “No”
    While ($IconPath -eq “No”) {$IconPath = Get-IconPath}

    $Choice = Prompt-Choice “Continue with icon assignment” “$(“Set ” + $SelectedApp.DisplayName + “‘s Icon to ” + $IconPath)”
    If ($Choice -eq “Yes”) {
    $SelectedApp | Set-RDRemoteApp -IconPath $IconPath
    }
    Else {
    Prompt-Choice “Icon Assigment” “$(“Cancelled ” + $SelectedApp.DisplayName + “‘s Icon Assigment”)” “E”
    }
    }
    Else {
    Prompt-Choice “Icon Assigment” “$(“Cancelled No App Selected.”)” “W”
    }

  11. funny video says:

    There are definitely loads of particulars like that to take into consideration. That is a nice point to carry up. I provide the thoughts above as common inspiration however clearly there are questions just like the one you convey up the place a very powerful thing might be working in trustworthy good faith. I don?t know if greatest practices have emerged round issues like that, however I am sure that your job is clearly identified as a good game. Both girls and boys really feel the impact of just a moment’s pleasure, for the remainder of their lives.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

Blog Authors
https://paypal.me/ArjanMensch
BTC:1AiAL6QDbfNPiduYYEoy3iNS2m6UKJW2He

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

Join 443 other followers

Blog Stats
  • 3,548,395 hits
  • An error has occurred; the feed is probably down. Try again later.
  • An error has occurred; the feed is probably down. Try again later.
%d bloggers like this: