Forum Discussion

Kai_M__48813's avatar
Sep 27, 2017

creating custom variable

hi,

 

i have created a custom variable to be used for an AD query, to find groupmembership. This is for deploying activesync. AD Auth is working just fine, but im struggling to populate the sAMaccountname, as the automatic activesync setup on the phones seem to add a default \ in front of the username.. is it possible to remove this in the query, so that the custom variable will read domain\username, and not domain\5cusername ?

 

2 Replies

  • Hello Kai M.

     

    Yes you can make string manipulation withen a "Variable Assign" item.

     

    Enter you custom variable name and choose for the right side "Custome Expression"

     

    To help you creating the custom expression could you please give me exactly what you want to modify... Not sure I understand in your example what the activesync is adding...

     

  • Hi,

    When working with Exchange, I always enable "split domain from username" check box in logon page. after that, 3 variables are created when user authentication with domain\username:

    • session.logon.last.username : username
    • session.logon.last.domain : domain
    • session.logon.last.logonname : domain\username

    then I create an AD query with filter :

    (|(sAMAccountName=%{session.logon.last.username})(UserPrincipalName=%{session.logon.last.logonname})(mail=%{session.logon.last.logonname}))
    

    and assign username from smaccounrname before AD Auth

    session.logon.last.username = mcget {session.ad.last.attr.sAMAccountName}
    

    to support multiple tries, insert all these boxes (from logon page to AD Auth) in a macro with loop count 3 and change AD Auth reties to 1.