As of V10 SP8 there is an additional option for role selection. Not only selection via Windows login is possible, but also via a freely definable variable, which is provided by a LDAP[112] server for example.[113]
This is especially advantageous when not all user names are known.
The configuration
happens in $CADENAS_SETUP/plinkcommon.cfg, in the
block LOGIN via keys
AutoLoginUserX. (If no keys AutoLoginUserX are stated, the
standard role selection is performed and the username is used.)
If AutoLoginUserX is stated, then
exactly this is used. The key values are variables, which control the mode
of role selection.
Via key value
variable %user% you can check, whether there is
an entry for the username in the plinkusers.cfg. So use this
variable in the first AutoLoginUserX key, if you want to check the
standard case at
first.
Via key value
variable %ds.computer.company% you can read
a variable value from the defined LDAP server and check, whether there is an
entry in the plinkusers.cfg for this.
At first the
search is performed for the first AutoLoginUser in the plinkusers.cfg, then for the
second and so on. If no value is matching, then the wild card user is
used.
In the key
ldapURLspecify the URL of the LDAP server.[Login] ldapURL=ldap://CADENAS.QA/DC=CADENAS,DC=QA
Read value from the LDAP server
In the key
AutoLoginUser1you can specify the variable to be read.[LOGIN] AutoLoginUser0=%user% AutoLoginUser1=%ds.computer.company%
In this example, at first it is checked whether there is an entry for the username in the
plinkusers.cfg(AutoLoginUser0) and then for the value "company" in the directory server.Regular expressions can filter the read value.
For each entry in AutoLoginUser, a list of regular expressions can be defined. The relation between key AutoLoginUserX and block AutoLoginExprListX is established by the number at the end of keys and blocks.
AutoLoginUser1=%ds.computer.company%[AutoLoginExprList1] Expr0=^.{2}With the expression above only the first two characters of "company" are used.

![[Note]](https://webapi.partcommunity.com/service/help/latest/pages/de/installation_ecatalogsolutions/doc/images/note.png)