This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Auto Generation Exchange Alias

Is there away to auto generate the alias similar to the user logon name generation in ARS.

I would usually set the alias as the user logon name, however these need to be different now.
  • Hello,

    You should create E-mail Alias Generation Policy.
  • The email alias generation lacks the logic to add multiple generation rules like the user logon name generation policy.

    For instance, I would like to have the alias be first.lastname, then on conflict use first.initial.lastname.

    You cannot specify this in the email alias generation.
  • You are correct, you cant use multiple alias generation rules within Email alias generation policy in ARS.
    I guess, ARS scripting can help here. Please take a look at this sample - wiki.activeroles.inside.quest.com/.../Custom_script-based_User_Logon_Name_Generation_policy You could use the sample as a starting point for your solution. For this you should change the sample to manage mailnickName instead of sAMAccountName
  • here is the powershell shell script....
    we are taking first character of first name followed by last name.. if this is available then first 2 character of first name followed by last name and so on..

    ==========
    function onPostModify($Request)
    {
    $givenname = $Dirobj.get("givenname").ToLower()
    $sn = $Dirobj.get("sn").ToLower().split()[-1]
    $Alias1 = $givenname.substring(0,1) + $sn.Replace(' ','')

    $exit = 0

    do
    {
    try
    {
    $user = get-recipient "$Alias1@amal.ae" -ErrorAction SilentlyContinue


    if ($user -eq $null) {$exit = 1}

    else

    { $Alias1 = $givenname.substring(0,2) + $sn }

    $user = get-recipient "$Alias1@amal.ae" -ErrorAction SilentlyContinue

    if ($user -eq $null) {$exit = 1}
    else
    { $Alias1 = $givenname.substring(0,3) + $sn }

    $user = get-recipient "$Alias1@amal.ae" -ErrorAction SilentlyContinue
    if ($user -eq $null) {$exit = 1}
    else
    { $Alias1 = $givenname.Substring(0,4) + $sn }

    $user = get-recipient "$Alias1@amal.ae" -ErrorAction SilentlyContinue
    if ($user -eq $null) {$exit = 1}
    else
    { $Alias1 = $givenname.Substring(0,5) + $sn }

    $user = get-recipient "$Alias1@amal.ae" -ErrorAction SilentlyContinue
    if ($user -eq $null) {$exit = 1}
    else
    { $Alias1 = $givenname.Substring(0,6) + $sn }


    }

    catch
    {

    $exit = 1
    }
    }

    while($exit -eq 0)

    $Alias1