def testPyad(): rows = getListByDate('2008-02-01') for usuario in rows: user = pyad.from_cn(usuario) print type(user) print user raw_input("Pulse para continuar ...") print len(rows)
def add_to_group(username, password, server, groupdn, cn): from pyad import pyad pyad.set_defaults(ldap_server=server, username=username, password=password) group = pyad.from_dn(groupdn) user = pyad.from_cn(cn) group.add_members([user]) print "Moved " + user + "to " + group