21-Feb-2016
11:08
- last edited on
23-Nov-2022
13:27
by
JRahm
I am trying to set up a process where a visitor validates against an AD Authentication stage which then leads to an LDAP Query that checks membership of a AD Group. (This all works). What I do then is check membership of a group that starts with "CN=RDS-". and then isolate the actual groupname. The groupname is the required Remote Desktop Hostname....
Searching DEVCentral I found some code that appears to be what I need with edits for my variables I entered this into the Branch expression for the Remote Desktop
if { [info exists "RDTOP"] }{unset RDTOP;};
foreach value [mcget {session.ad.last.attr.memberOf}] {
if $value contains "CN=RDS-" regexp {CN=([^,]+)} $value CNFull CNValue;
set RDTOP= CNValue;
unset CNFull;
unset CNValue;
}
The variable RDTOP I entered as the Remote Desktop destination Hostname value %{RDTOP}. When looking at the logs I get this
Although I get the webtop and Remote desktop Icon The remote desktop appears to start but then errors with cannot connect. Because of the syntax error the Variable RDTOP is not being passed to the hostname destination correctly. Also when looking the session report the session variables in the manage sessions screen returns nothing.. Help!
Thanks for any help!
The novice newbie 🙂
22-Feb-2016
03:13
- last edited on
23-Nov-2022
13:26
by
JRahm
A couple things...
If you log the RDTOP variable (log local0. "RDTOP: $RDTOP), does it show you that value that you expect in the ltm log?
Also, I think a problem is that you're setting a variable in an iRule, but that variable is not going to be accessible from the RDP profile. What you should do is use ACCESS::session to set a session variable and use that. So you'd add something like this to the iRule: ACCESS::session data set session.custom.rdpname $RDTOP. Then in your RDP resource, you could set the host to %{session.ustom.rdpname}.
Hope this helps.