RDS 2019 - Modify RDP File Settings for a single RemoteApp

Sam Trillus 11 Reputation points
2020-08-07T01:06:11.213+00:00

Hi All

I am running an RDS 2019 Deployment with 2 GW, 2 CB, 3 SH.

Users are starting the RemoteApp via RDWeb.

Now i want to modify the RDP File Settings for a single RemoteApp, to disable the "devicestoredirect:s: and
drivestoredirect:s:"-settings, but keep the default settings for all others.

If i change the Setting in the Registry "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\0000\Applications\" via RDPFileContents, the Settings are lost each time the IIS Restarts, as it seems they get overwritten by the Deployment Settings.

Changing the Settings in the "Collection Settings" would apply to all RemoteApps in that Collection, which is what i want to avoid.

Any help will be appreciated.

Thank you in advance!

Best Regards
Sam

Windows for business Windows Client for IT Pros User experience Remote desktop services and terminal services
Windows for business Windows Server User experience Other
{count} vote

4 answers

Sort by: Most helpful
  1. Sam Trillus 11 Reputation points
    2020-08-07T10:18:20.78+00:00

    Thank you for your time, Eleven!

    I had already thought about that workaround, but for my understanding, this is not how "central published ressources" should work.
    I can not tell ~1500 Users that they have to fiddle around with Notepad to get the RDP File for that specific Application working.

    One thing that i do not understand is, that the corresponding registry key lists all remote apps with each has its own "RDPFileSettings"-String, but i can not customize them one by one because this setting gets overwritten by the String definded in the "DeploymentSettings"-Key. I got a feeling that this is a very awkwards Design.

    And with the Way MS changed RDS from 2008R2 to 2012R2, its not even possible to publish this remote app in its own Collection, as i would have to use at least one (better two...) dedicated SH for only that purpose. headshaking

    The Root Cause why i am asking for this is, that we are using a java application which seems to have an Issue with client drive redirection which makes the integrated File Explorer extremely slow. But we need the Client Drives accessible for other Application which do not have that issue. We have that issue only via RemoteApp. If we use the Application via RemoteDesktop everything works fine.

    I am looking forward hopefully to any further advices.

    Thank you very much in advance!

    Best Regards
    Sam

    1 person found this answer helpful.
    0 comments No comments

  2. Anonymous
    2020-08-07T07:56:11.917+00:00

    Hi,

    Please try below to see if it helps.

    1. Start the specific remote app using RDWeb, and save the rdp file.
      16278-image.png
    2. Open the saved rdp file with Notepad.
      16299-image.png
    3. Modify the value of devicestoredirect:s: and drivestoredirect:s: as desired.
      16220-image.png
    4. Close and save the file. And use this modified rdp file to start the remote App.

    Hope the information could resolve your requirement.

    Thanks,
    Eleven

    0 comments No comments

  3. Anonymous
    2020-08-10T03:41:08.847+00:00

    Hi,

    Unfortunately, there is no more better solution at the moment.

    If the provided suggestion is not applicable, the only way is to create a new collection on a separate session host to publish the specific Remote App.

    But you could post your suggestion to below link so that the remote desktop services product group can check to see if new feature will be released in the future.

    Remote Desktop Services
    https://remotedesktop.uservoice.com/forums/266795-remote-desktop-services

    Thanks,
    Eleven

    0 comments No comments

  4. T-ICT | Gerrit Heinen 5 Reputation points
    2024-11-11T10:14:24+00:00

    Hi all!

    For the people searching for a solution to this.

    I was also strugling with this shortcoming in RemoteApp publishing, so I thought, maybe ChatGPT could help me out. And it did.

    U can use this PS to edit the registry and also sign the changes made! Additionally maybe you can put the script in scheduled task to be executed after a certain event, or when the registry is having the wrong value or something.

    # Define the path to the registry key and the name of the value
    $RegistryPath = "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\$COLLECTION\Applications\$APP"
    $ValueName = "RDPFileContents"
    
    # Read the current RDP content from the registry
    $CurrentValue = Get-ItemProperty -Path $RegistryPath -Name $ValueName | Select-Object -ExpandProperty $ValueName
    Write-Output "Current value of $ValueName is: `n$CurrentValue"
    
    # Define the parts to replace and their replacements in a hashtable
    $Replacements = @{
        "redirectclipboard:i:1" = "redirectclipboard:i:0"
        "OldValue2" = "NewValue2"
        "OldValue3" = "NewValue3"
        # Add more old-new pairs as needed
    }
    
    # Make replacements
    $NewValue = $CurrentValue
    foreach ($OldPart in $Replacements.Keys) {
        $NewPart = $Replacements[$OldPart]
        if ($NewValue -match $OldPart) {
            $NewValue = $NewValue -replace $OldPart, $NewPart
            Write-Output "Replaced '$OldPart' with '$NewPart'"
        } else {
            Write-Output "The part '$OldPart' was not found in the current value."
        }
    }
    
    # Create a temporary file to store the modified RDP content
    $TempRdpPath = [System.IO.Path]::GetTempFileName() + ".rdp"
    Set-Content -Path $TempRdpPath -Value $NewValue
    
    # Get the thumbprint of the RD Publishing certificate
    $Thumbprint = (Get-RDCertificate -Role RDPublishing).Thumbprint
    Write-Output "Using certificate thumbprint: $Thumbprint"
    
    # Run rdpsign with the thumbprint to generate the new signature
    & rdpsign.exe /sha256 $Thumbprint $TempRdpPath
    
    # Read the signed RDP file to get the new content with the updated signature
    $SignedContent = Get-Content -Path $TempRdpPath -Raw
    
    # Update the registry with the signed content
    Set-ItemProperty -Path $RegistryPath -Name $ValueName -Value $SignedContent
    Write-Output "The value of $ValueName has been updated with the new signature."
    
    # Clean up the temporary file
    Remove-Item -Path $TempRdpPath -Force
    
    

    Hopefully someone finds this useful.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.