---
title: "Add new users to external user directories using CLI"
canonical: "https://support.appfire.com/space/SUPPORT/89133091/Add%20new%20users%20to%20external%20user%20directories%20using%20CLI"
format: markdown
---
<span style="color: #333333">This article highlights the configuration setup required to add new users to external user directories using Command Line Interface(CLI).</span>

## <span style="color: #333333">Instructions</span>

<span style="color: #333333">To add new users to the external LDAP directory through CLI, you must have the below configuration in place, i.e.:</span>

<span style="color: #333333">Ensure that your external LDAP directory is listed at the top order of </span>*<span style="color: #333333">User Directories</span>*<span style="color: #333333">.</span>  
> Macro (inline-media-image)



- <span style="color: #333333">If the directory type is </span>**<span style="color: #333333">Microsoft Active Directory</span>**<span style="color: #333333"> or </span>**<span style="color: #333333">LDAP</span>**<span style="color: #333333">, configure with both </span><u><span style="color: #333333">READ\WRITE</span></u><span style="color: #333333"> permissions (i.e Modifying users, groups and memberships in Jira/Confluence causes the changes to be applied directly to your LDAP server. Your configured LDAP user must have modification permissions on your LDAP server.)</span>  
> Macro (inline-media-image)
- <span style="color: #333333">If the directory type is </span>**<span style="color: #333333">Delegated LDAP Authentication</span>**<span style="color: #333333">, Jira/Confluence can use LDAP for user authentication only. To be able to log in to Jira/Confluence with this configuration:</span>
  - <span style="color: #333333"> users must either be created first in Jira/Confluence or </span>
  - <span style="color: #333333">the option 'Copy User on First Login' can be selected to automatically add them to JIRA/Confluence’s internal directory. </span>

<span style="color: #333333">Copied users can subsequently be modified in Jira/Confluence, but modifications are not reflected on the LDAP server.</span>  
<span style="color: #333333">Groups and memberships from the LDAP server are not used. However, users from LDAP can be added to groups maintained in Jira/Confluence’s internal directory.</span>  
> Macro (inline-media-image)



<span style="color: #333333">Once the mentioned configuration is in place,</span>

1. <span style="color: #333333">Create a test user from Jira/Confluence GUI and validate if it’s added to the External LDAP directory.</span>
2. <span style="color: #333333">Perform the CLI action </span>**<span style="color: #333333">addUser</span>**<span style="color: #333333"> to create a new user and this creates a new user as per the </span><u><span style="color: #333333">order</span></u><span style="color: #333333"> in the </span><span style="color: #333333">configured</span><span style="color: #333333"> user directories.</span>

```shell
--action addUser --userId "testuser1" --userFullName "Test User1" --userEmail "testuser1x@examplegear.com" --continue --userPassword "userPassword1"
```