title: creating entry into ladp directory using python
body: <p>I am trying to create entry into LDAP using python it gives me error {'info': 'no global superior knowledge', 'desc': 'Server is unwilling to perform'}
  following is my code for this</p>
  
  <pre><code>import ldap
  import ldap.modlist as modlist
  fname="dayanand"
  lname="dayanand"
  username="dayanand"
  employee_num='102'
  domain="gmail.com"
  base_dn="xyz"
  l = ldap.initialize("ldap://localhost")
  l.simple_bind_s("cn=admin,dc=somnath,dc=zankar,dc=org","zankar")
  user_dn = "cn=admin,dc=somnath,dc=org"
  user_attrs = {}
  #user_attrs['objectClass'] = \
  #          ['top', 'person', 'organizationalPerson', 'user']
  user_attrs['cn'] = fname + ' ' + lname
  #user_attrs['userPrincipalName'] = username + '@' + domain
  #user_attrs['sAMAccountName'] = username
  user_attrs['givenName'] = fname
  user_attrs['sn'] = lname
  user_attrs['displayName'] = fname + ' ' + lname
  #user_attrs['userAccountControl'] = '514'
  user_attrs['mail'] = username + '@host.com'
  #user_attrs['employeeID'] = employee_num
  user_attrs['homeDirectory'] = '\\\\server\\' + username
  #user_attrs['homeDrive'] = 'H:'
  #user_attrs['scriptPath'] = 'logon.vbs'
  user_ldif = modlist.addModlist(user_attrs)
  
  # Convert our dict to nice syntax for the add-function using modlist-module
  ldif = modlist.addModlist(user_attrs)
  
  # Do the actual synchronous add-operation to the ldapserver
  try:
     l.add_s(user_dn,ldif)
  except ldap.LDAPError, error_message:
      print "Error adding new user: %s" % error_message
  </code></pre>