Skip to main content
Yesolo
Explorer
October 12, 2023
Solved

Fortigate change username mapping from AD

  • October 12, 2023
  • 5 replies
  • 3613 views

When create users from LDAP server (in my case, Microsoft AD server), the ID (username on Fortigate) of created user is actually "display name" of this user in AD. The request is to change the username on Fortigate from this display name to "sAMAccountName" or "userPrincipalName". Is it possible? And how?

 

 

    Best answer by bpozdena_FTNT

    Yes, it's possible to change. By default LDAP users will be imported based on their 'CN' attribute, which is usually the same as 'DisplayName'.

     

    You will need to change the CNID value under your LDAP profile to change the behavior.

     

    For instance, if you want your users to be imported with usernames based on the 'userPrincipalName' attribute, use the bellow configuration:

    config user ldap     edit "YOUR-LDAP-PROFILE-NAME"         set cnid "userPrincipalName"     next end

     

    If you want the imported usernames be based on the 'sAMAccountName', simply change the settings as bellow:

    config user ldap     edit "YOUR-LDAP-PROFILE-NAME"         set cnid "sAMAccountName"     next end

     

    Just note that after you change the value, you will need to delete and re-import all users again.

    5 replies

    Yesolo
    YesoloAuthor
    Explorer
    October 12, 2023

    Snapshot:7848310.png

    Durga_Ashwath
    Staff
    Staff
    October 12, 2023
    Yesolo
    YesoloAuthor
    Explorer
    October 13, 2023

    Hi, thanks for the reply, but we don't have a FSSO Collector Agent now, we will try this later if other solutions don't work.

    bpozdena_FTNT
    Staff
    Staff
    October 12, 2023

    Yes, it's possible to change. By default LDAP users will be imported based on their 'CN' attribute, which is usually the same as 'DisplayName'.

     

    You will need to change the CNID value under your LDAP profile to change the behavior.

     

    For instance, if you want your users to be imported with usernames based on the 'userPrincipalName' attribute, use the bellow configuration:

    config user ldap     edit "YOUR-LDAP-PROFILE-NAME"         set cnid "userPrincipalName"     next end

     

    If you want the imported usernames be based on the 'sAMAccountName', simply change the settings as bellow:

    config user ldap     edit "YOUR-LDAP-PROFILE-NAME"         set cnid "sAMAccountName"     next end

     

    Just note that after you change the value, you will need to delete and re-import all users again.

    Yesolo
    YesoloAuthor
    Explorer
    October 13, 2023

    Hi, it works, thank you very much!

    Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
    Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.