Forum Discussion
Cameras To Redirect Custom RDP Property Does not Work
I have found a solution for this:
Go to the following location Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms<Farm Name>\RemoteDesktops<Resource Name>\RDPFileContents Export the registry file with the program O&O Regeditor. Make a copy of your backup and edit the copy. Add the following line to the config: camerastoredirect:s:* with notepad plus plus Save the file Import the reg file with O&O Regeditor
Ryan_Janssen Thanks for the tip.
I actually had to create a VBscript because notepad++ wasn't breaking the lines properly.
I'll put the script on my GitHub repo this weekend.
https://github.com/roanp/RDS-SwissKnife
- Matt_OCCMay 19, 2020Copper Contributor
Ryan_Janssen So editing this does not invalidate the signing of the rdp file when it is downloaded? I suppose that this will need to be updated if the feed settings are ever updated by an admin
RoanPaes I don't see a script in the github repository you mention. But I believe using get-itemproperty and set-itemproperty with $value += "camerastoredirect:s:*`n" should be sufficient
- Matt_OCCMay 19, 2020Copper Contributor
I was able to run this powershell command on each connection broker and it was able to work. I would also still run the Set-RDSessionCollectionConfiguration command for the custom value as well.
<collection alias> would be the value of CollectionAlias from Get-RDSessionCollection
$alias = <collection Alias> $RDPFileContents = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\$alias\RemoteDesktops\$alias\").RDPFileContents $RDPFileContents += "camerastoredirect:s:*`n" Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\$alias\RemoteDesktops\$alias\" -Name RDPFileContents -Value $RDPFileContents
- MCS-JFApr 02, 2024Copper Contributor
Thank you, this helped me no end! I have used your original commands and created a more complete PowerShell script that checks to see if you already have the change applied before applying.
# Change the alias variable below, for a Remote Desktop resource type use the CollectionAlias from... Get-RDVirtualDesktopCollection | Select-Object CollectionName, CollectionAlias $alias = "ENTER_YOUR_ALIAS_HERE" # Define the registry key path $registry_key_path = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\$alias\RemoteDesktops\$alias" # Define the existing registry value name $existing_value_name = "RDPFileContents" # Define the value to add $value_to_add = "camerastoredirect:s:*`n" # Define the value to check $value_to_check = "camerastoredirect:s:*" # Get the current value of the registry key try { $current_value = Get-ItemProperty -Path $registry_key_path -Name $existing_value_name -ErrorAction Stop | Select-Object -ExpandProperty $existing_value_name } catch { $current_value = "" } # Check if the value_to_add is already present in the current value if ($current_value -match $value_to_check) { Write-Host "'$value_to_check' is already present in the registry value '$existing_value_name' in the key '$registry_key_path'." } else { # Construct the full value $full_value = "$value_to_add $current_value" # Use PowerShell to set the registry value try { Set-ItemProperty -Path $registry_key_path -Name $existing_value_name -Value $full_value Write-Host "Successfully added '$value_to_add' to the registry value '$existing_value_name' in the key '$registry_key_path'." } catch { Write-Host "Error: $_" } }