Cameras To Redirect Custom RDP Property Does not Work

%3CLINGO-SUB%20id%3D%22lingo-sub-1277538%22%20slang%3D%22en-US%22%3ECameras%20To%20Redirect%20Custom%20RDP%20Property%20Does%20not%20Work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1277538%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20mstsc.exe%2C%20under%26nbsp%3BLocal%20Resources%20%26gt%3B%20More..%20there%20is%20an%20option%20for%26nbsp%3BVideo%20capture%20devices.%26nbsp%3B%20Which%20lists%20my%20webcam%20and%20Devices%20that%20I%20plug%20in%20later.%26nbsp%3B%20I%20have%20determined%20that%20this%20option%20the%20an%20RDP%20file%20is%20the%20string%26nbsp%3Bcamerastoredirect%3As%3A*%26nbsp%3B%20So%20what%20I%20have%20done%20is%20ran%20the%20following%20command%20on%20my%20Connection%20Broker%20so%20that%20this%20line%20will%20be%20added%20to%20rdp%20file%20generated%20by%20the%20feed.%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3ESet-RDSessionCollectionConfiguration%20-CollectionName%20%24CollectionName%20-CustomRdpProperty%20%22camerastoredirect%3As%3A*%22%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EWhen%20I%20run%20Get-RDSessionCollectionConfiguration%20I%20see%20the%20value%20has%20been%20added%20to%20CustomRdpProperty%20along%20with%20%22use%20redirection%20server%20name%3Ai%3A1%22%20which%20seems%20to%20be%20a%20default%20on%20all%20collections.%3CBR%20%2F%3EWhat%20I%20am%20trying%20to%20solve%20is%2C%20why%20does%20my%20custom%20RDP%20property%20not%20apply%20to%20the%20RDP%20files%20that%20are%20downloaded.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1277538%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ERemote%20Desktop%20Services%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1284504%22%20slang%3D%22en-US%22%3ERe%3A%20Cameras%20To%20Redirect%20Custom%20RDP%20Property%20Does%20not%20Work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1284504%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%20exactly%20the%20same%20issue%2C%20is%20there%20already%20a%20solution%20for%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1284995%22%20slang%3D%22en-US%22%3ERe%3A%20Cameras%20To%20Redirect%20Custom%20RDP%20Property%20Does%20not%20Work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1284995%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20found%20a%20solution%20for%20this%3A%3C%2FP%3E%3CPRE%3EGo%20to%20the%20following%20location%0AComputer%5CHKEY_LOCAL_MACHINE%5CSOFTWARE%5CMicrosoft%5CWindows%20NT%5CCurrentVersion%5CTerminal%20Server%5CCentralPublishedResources%5CPublishedFarms%26lt%3BFarm%20Name%26gt%3B%5CRemoteDesktops%26lt%3BResource%20Name%26gt%3B%5CRDPFileContents%0A%0AExport%20the%20registry%20file%20with%20the%20program%20O%26amp%3BO%20Regeditor.%0AMake%20a%20copy%20of%20your%20backup%20and%20edit%20the%20copy.%0AAdd%20the%20following%20line%20to%20the%20config%3A%20camerastoredirect%3As%3A*%20with%20notepad%20plus%20plus%0ASave%20the%20file%0AImport%20the%20reg%20file%20with%20O%26amp%3BO%20Regeditor%26nbsp%3B%26nbsp%3B%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1361842%22%20slang%3D%22en-US%22%3ERe%3A%20Cameras%20To%20Redirect%20Custom%20RDP%20Property%20Does%20not%20Work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1361842%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F610898%22%20target%3D%22_blank%22%3E%40Ryan_Janssen%3C%2FA%3E%26nbsp%3B%20Thanks%20for%20the%20tip.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20actually%20had%20to%20create%20a%20VBscript%20because%20notepad%2B%2B%20wasn't%20breaking%20the%20lines%20properly.%3C%2FP%3E%3CP%3EI'll%20put%20the%20script%20on%20my%20GitHub%20repo%20this%20weekend.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Froanp%2FRDS-SwissKnife%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Froanp%2FRDS-SwissKnife%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1403666%22%20slang%3D%22en-US%22%3ERe%3A%20Cameras%20To%20Redirect%20Custom%20RDP%20Property%20Does%20not%20Work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1403666%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F610898%22%20target%3D%22_blank%22%3E%40Ryan_Janssen%3C%2FA%3E%26nbsp%3BSo%20editing%20this%20does%20not%20invalidate%20the%20signing%20of%20the%20rdp%20file%20when%20it%20is%20downloaded%3F%26nbsp%3B%20I%20suppose%20that%20this%20will%20need%20to%20be%20updated%20if%20the%20feed%20settings%20are%20ever%20updated%20by%20an%20admin%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F657046%22%20target%3D%22_blank%22%3E%40RoanPaes%3C%2FA%3E%26nbsp%3BI%20don't%20see%20a%20script%20in%20the%20github%20repository%20you%20mention.%26nbsp%3B%20But%20I%20believe%20using%20get-itemproperty%20and%20set-itemproperty%20with%20%24value%20%2B%3D%20%22camerastoredirect%3As%3A*%60n%22%20should%20be%20sufficient%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1403719%22%20slang%3D%22en-US%22%3ERe%3A%20Cameras%20To%20Redirect%20Custom%20RDP%20Property%20Does%20not%20Work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1403719%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20able%20to%20run%20this%20powershell%20command%20on%20each%20connection%20broker%20and%20it%20was%20able%20to%20work.%26nbsp%3B%20I%20would%20also%20still%20run%20the%26nbsp%3BSet-RDSessionCollectionConfiguration%20command%20for%20the%20custom%20value%20as%20well.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CCOLLECTION%20alias%3D%22%22%3E%20would%20be%20the%20value%20of%20CollectionAlias%20from%20Get-RDSessionCollection%3C%2FCOLLECTION%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%24alias%20%3D%20%3CCOLLECTION%20alias%3D%22%22%3E%0A%24RDPFileContents%20%3D%20(Get-ItemProperty%20%22HKLM%3A%5CSOFTWARE%5CMicrosoft%5CWindows%20NT%5CCurrentVersion%5CTerminal%20Server%5CCentralPublishedResources%5CPublishedFarms%5C%24alias%5CRemoteDesktops%5C%24alias%5C%22).RDPFileContents%0A%24RDPFileContents%20%2B%3D%20%22camerastoredirect%3As%3A*%60n%22%0ASet-ItemProperty%20%22HKLM%3A%5CSOFTWARE%5CMicrosoft%5CWindows%20NT%5CCurrentVersion%5CTerminal%20Server%5CCentralPublishedResources%5CPublishedFarms%5C%24alias%5CRemoteDesktops%5C%24alias%5C%22%20-Name%20RDPFileContents%20-Value%20%24RDPFileContents%3C%2FCOLLECTION%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1404185%22%20slang%3D%22en-US%22%3ERe%3A%20Cameras%20To%20Redirect%20Custom%20RDP%20Property%20Does%20not%20Work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1404185%22%20slang%3D%22en-US%22%3ELike%20I%20thought%2C%20editing%20the%20collection%20overwrites%20this%20value%20and%20it%20has%20to%20be%20updated%20again.%20The%20fact%20that%20the%20property%20does%20not%20get%20to%20the%20file%20property%20is%20a%20bug%20I%20believe.%20How%20can%20we%20escalate%20this%20with%20Microsoft's%20rdp%20team%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1428251%22%20slang%3D%22en-US%22%3ERe%3A%20Cameras%20To%20Redirect%20Custom%20RDP%20Property%20Does%20not%20Work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1428251%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F386796%22%20target%3D%22_blank%22%3E%40Matt_OCC%3C%2FA%3E%26nbsp%3B%20I%20was%20unable%20to%20upload%20the%20VB%20because%20of%20clients%20info%20within%20the%20file.%26nbsp%3B%20But%20I%20feel%20your%20solution%20works%20way%20better.%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThe%20one%20I%20used%20roughly%20looks%20like%20the%20below%20(it%20is%20missing%20lots%20of%20bits%20and%20pieces%2C%20but%20the%20idea%20is%2C%20once%20you%20have%20your%20registry%20exported%2C%20you%20create%20the%20VBS%20file%20with%20all%20you%20need%20plus%20the%20camera%20support).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26amp%3B%20%22promptcredentialonce%3Ai%3A1%22%20%26amp%3B%20VbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20%22videoplaybackmode%3Ai%3A1%22%20%26amp%3B%20VbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20%22audiocapturemode%3Ai%3A1%22%20%26amp%3B%20VbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20%22gatewayusagemethod%3Ai%3A2%22%20%26amp%3B%20VbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20%22gatewayprofileusagemethod%3Ai%3A1%22%20%26amp%3B%20VbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20%22gatewaycredentialssource%3Ai%3A0%22%20%26amp%3B%20VbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20%22full%20address%3As%3AREMOTE.yourdomain.com%22%20%26amp%3B%20VbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20%22gatewayhostname%3As%3Aremote.yourdomain.com%22%20%26amp%3B%20VbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20%22workspace%20id%3As%3AREMOTE.yourdomain.com%22%20%26amp%3B%20VbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20%22use%20redirection%20server%20name%3Ai%3A1%22%20%26amp%3B%20VbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20%22loadbalanceinfo%3As%3Atsv%3A%2F%2FMS%20Terminal%20Services%20Plugin.1.RDS-Desktop%22%20%26amp%3B%20VbCrLf%20_%3C%2FP%3E%3CP%3EDim%20WSHShell%3CBR%20%2F%3Eset%20WSHShell%20%3D%20CreateObject(%22WScript.Shell%22)%3CBR%20%2F%3EWSHShell.RegWrite%20%22HKEY_LOCAL_MACHINE%5CSOFTWARE%5CMicrosoft%5CWindows%20NT%5CCurrentVersion%5CTerminal%20Server%5CCentralPublishedResources%5CPublishedFarms%5CBCB-Desktop%5CRemoteDesktops%5CBCB-Desktop%5CRDPFileContent%22%2C%20myval%2C%20%22REG_SZ%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1520068%22%20slang%3D%22en-US%22%3ERe%3A%20Cameras%20To%20Redirect%20Custom%20RDP%20Property%20Does%20not%20Work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1520068%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F657046%22%20target%3D%22_blank%22%3E%40RoanPaes%3C%2FA%3E%26nbsp%3BI%20found%20editing%20the%20registry%20directly%20through%20powershell%20the%20easies.%26nbsp%3B%20I've%20run%20into%20the%20issue%20with%20a%20HA%20collection%20continually%20gets%20written%20over%20any%20time%20any%20collection%20in%20the%20deployment%20changed.%26nbsp%3B%20It%20seems%20to%20be%20part%20of%20the%20sync%20process%20between%20the%20collection%20brokers.%26nbsp%3B%20I've%20written%20a%20small%20script%20to%20cycle%20through%20all%20of%20the%20collections%20and%20append%20the%20registry%20to%20deal%20with%20it%2C%20just%20haven't%20decided%20on%20when%20I%20should%20trigger%20this.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

In mstsc.exe, under Local Resources > More.. there is an option for Video capture devices.  Which lists my webcam and Devices that I plug in later.  I have determined that this option the an RDP file is the string camerastoredirect:s:*  So what I have done is ran the following command on my Connection Broker so that this line will be added to rdp file generated by the feed.

Set-RDSessionCollectionConfiguration -CollectionName $CollectionName -CustomRdpProperty "camerastoredirect:s:*"

When I run Get-RDSessionCollectionConfiguration I see the value has been added to CustomRdpProperty along with "use redirection server name:i:1" which seems to be a default on all collections.
What I am trying to solve is, why does my custom RDP property not apply to the RDP files that are downloaded.

8 Replies
Highlighted

We have exactly the same issue, is there already a solution for this?

Highlighted

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  

 

Highlighted

@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

Highlighted

@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

Highlighted

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

 

 

Highlighted
Like I thought, editing the collection overwrites this value and it has to be updated again. The fact that the property does not get to the file property is a bug I believe. How can we escalate this with Microsoft's rdp team?
Highlighted

@Matt_OCC  I was unable to upload the VB because of clients info within the file.  But I feel your solution works way better. 


The one I used roughly looks like the below (it is missing lots of bits and pieces, but the idea is, once you have your registry exported, you create the VBS file with all you need plus the camera support).

 

 & "promptcredentialonce:i:1" & VbCrLf _
& "videoplaybackmode:i:1" & VbCrLf _
& "audiocapturemode:i:1" & VbCrLf _
& "gatewayusagemethod:i:2" & VbCrLf _
& "gatewayprofileusagemethod:i:1" & VbCrLf _
& "gatewaycredentialssource:i:0" & VbCrLf _
& "full address:s:REMOTE.yourdomain.com" & VbCrLf _
& "gatewayhostname:s:remote.yourdomain.com" & VbCrLf _
& "workspace id:s:REMOTE.yourdomain.com" & VbCrLf _
& "use redirection server name:i:1" & VbCrLf _
& "loadbalanceinfo:s:tsv://MS Terminal Services Plugin.1.RDS-Desktop" & VbCrLf _

Dim WSHShell
set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\CentralPublishedResources\PublishedFarms\BCB-Desktop\RemoteDesktops\BCB-Desktop\RDPFileContent", myval, "REG_SZ"

Highlighted

@RoanPaes I found editing the registry directly through powershell the easies.  I've run into the issue with a HA collection continually gets written over any time any collection in the deployment changed.  It seems to be part of the sync process between the collection brokers.  I've written a small script to cycle through all of the collections and append the registry to deal with it, just haven't decided on when I should trigger this.