To automatically import users from an LDAP or AD connection do the following. Note: this assumes there is one LDAP/AD connection setup on your instance of CloudBolt. If there are multiple, you may have to adjust the array index in line the "job_params.ldap = LDAPUtility.objects.all()" to  or .
On the C2 server, run:
$ /opt/cloudbolt/manage.py shell_plus
Once you get a prompt, enter the following commands line-by-line:
job_params = SyncUsersFromLdapParameters.objects.create()
job_params.ldap = LDAPUtility.objects.all()
job_params.failure_email_address = GlobalPreferences.get().cbadmin_email
job = Job(type="sync_users_from_ldap", job_parameters=job_params )
This will create a job that will connect to your LDAP server and import the users matching the search filter you provided.
Also keep in mind, by default AD limits the number of results returned, so if you try to import 1000+ users, AD will issue an error. To fix this error, you'll need to adjust this setting in your AD server.