class adLDAP - Wengex/PyADLdap GitHub Wiki

Principal Class to init the Framework. This class inherits from class adUtils

###_init_(self,dcs,username,password,basedn=None) Method constructor. Call to the self.connect() method to bind the LDAP connection.

  • Params:
  • (List)dcs : Domain Controller list.
  • (String)username : username to Active Directory ldap connect
  • (string)password : the username password
  • (string)basedn : minimun dcs to ldap connection must be work.
  • Return: None
  • Attributes: None

###_del_(self): Method destructor. Call the python ldap ubind_s method to unbind the LDAP connection

  • Params: None
  • Return: None
  • Attributes: None

###getController(self): Method to get random DC from domainControllers attribute. It is called from self.connect() method and initialize the self.controller attribute.

  • Params: None
  • Return: None
  • Attributes: self.controller

###connect(self): Method to configure minimun ldap parameters and create bind connection. It is called from self._init_() method.

  • Params: None
  • Return: (Boolean) If True then success bind and valid credentials, else, not success bind or invalid credentials.
  • Attributes: None

###authentication(self): Method to create bind connection and valid self.username and self.password credentials.

  • Params: None
  • Return: (Boolean) If True then success bind and valid credentials, else, not success bind or invalid credentials.
  • Attributes: None

###getADmaxPwdAge(self): Method to get Max-Pwd-Age attribute value

###getDomainRID(self): Method to get RID value from principal DN ObjectSID

###users(self): Property method to init adUsers class.

###computers(self): Property method to init adComputers class.

###groups(self): Property method to init adgroups class.

###objs(self): Property method to init adObjs class.

  • Params: None
  • Return: class adObjs instance
  • Attributes: None

###ous(self): Property method to init adOUs class.

  • Params: None
  • Return: class adOUs instance
  • Attributes: None