def len(result):
	""" Get length of Result (filtering invalid entries)
	
	LDAP results contain entries with empty DNs, at least this is what 
	Microsoft's AD returns. These empty entries are ldap urls pointing to 
	other directory trees. This is obsolete as of LDAPv3, so we ignore them.
	"""
	l = 0;
	for (dn, item) in result:
		if dn == None :
			continue
		l += 1
	return l