1) The script doesn't extract session names correctly when a USB device is attached.
The problem is that the script assumes that any line containing 'Name: ' is a session name.
Regrettably, the USB Filters section includes such a line.
VRDE property: Client/DisableClipboard = <not set>
VRDE property: Client/DisableUpstreamAudio = <not set>
USB Device Filters:
Name: LEXR PLUG DRIVE 
2) vrdp needs to be VRDE (as noted by others)
3) vrde port number extraction is broken by format changes. Easiest to extract it from the VRDE port: line
Attached script fixes these.
There may be more, but this is a start.