Skip to content
marten edited this page Feb 6, 2017 · 18 revisions

adcli_conn_connect:

  1. Cannot connect to domain controller

  2. Cannot authenticate

  3. Cannot login using username and/or password

  4. Cannot login using credentials cache

If adcli_conn_connect succeeds then it will return return code ADCLI_SUCCESS. Otherwise an error code.


result = adcli_conn_connect
throw exception if result != ADCLI_SUCCESS

VALUE cAdCliException;
...
rb_raise(cAdCliException, "adcli_conn_connect: %s", adcli_get_last_error());


adcli_error = adcli_conn_connect(... 

if(adcli_error)
    rb_raise(cAdCliException, "adcli_conn_connect: %s", adcli_get_last_error());


adcli_conn_new:

require 'radcli'
adconn = Adcli::AdConn.new("example.com")
adcli_conn * adcli_conn_new (const char *domain_name)

enroll = Adcli::AdEnroll.new(adconn)

enroll.join()

result = adcli_enroll_join
throw exception if result != ADCLI_SUCCESS

VALUE cAdCliException;
...
rb_raise(cAdCliException, "adcli_enroll_join: %s", adcli_get_last_error());


adcli_error = adcli_enroll_join(... 

if(adcli_error)
    rb_raise(cAdCliException, "adcli_enroll_join: %s", adcli_get_last_error());

enroll.password()

result = adcli_enroll_password
throw exception if result != ADCLI_SUCCESS

VALUE cAdCliException;
...
rb_raise(cAdCliException, "adcli_enroll_password: %s", adcli_get_last_error());


adcli_error = adcli_enroll_password(... 

if(adcli_error)
    rb_raise(cAdCliException, "adcli_enroll_password: %s", adcli_get_last_error());

enroll.delete()

result = adcli_enroll_delete
throw exception if result != ADCLI_SUCCESS

VALUE cAdCliException;
...
rb_raise(cAdCliException, "adcli_enroll_delete: %s", adcli_get_last_error());


adcli_error = adcli_enroll_delete(... 

if(adcli_error)
    rb_raise(cAdCliException, "adcli_enroll_delete: %s", adcli_get_last_error());