Forum Discussion
John_Masgalas_4
Nimbostratus
Jan 30, 2009iRule modification - rdp
I currently use the below iRule with our Terminal Services pool. It strips everything after the "@" in the username so that the persistence entry is only the username. I would like to modify it so tha...
John_Masgalas_4
Nimbostratus
Feb 10, 2009Hey guys,
I got it to work. Here is the iRule as I have it:
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
TCP::collect 25
binary scan [TCP::payload] x11a* msrdp
log local0. "Contents after binary scan: $msrdp"
if { [string equal -nocase -length 17 $msrdp "cookie: mstshash="] } {
set msrdp [string range $msrdp 17 end]
set len [string first "\n" $msrdp]
if { $len == -1 } {
TCP::collect
return
}
if { $msrdp contains "@" } {
log local0. "Setting data to: [getfield $msrdp "@" 1]"
set username [getfield $msrdp "@" 1]
} elseif { $msrdp contains "\\" } {
log local0. "Setting data to: [getfield $msrdp "\\" 3]"
set username [getfield $msrdp "\\" 3]
} else {
set username $msrdp
log local0. "Setting data to: $msrdp"
}
set finalusername [string tolower $username]
set finalusername [string trim $finalusername]
log local0. "User Being Persisted is: |$finalusername|"
persist uie $finalusername 10800
}
TCP::release
}
The only thing is that 9 character limit. I know this is an MS TS limitation but is ther a way around it. Thanks for all your input and help though. You have steered my in the right direction!
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects