Hello everyone,
I would like to first say that I am not a developer of any sort but I can usually fight my way through some scripting languages…most of the time with ugly form.
After a few days of reading java docs and examples, I have been successful at querying our Active Directory for some user attributes in a Project. However, [color=#FF0040]Microsoft limits the results in one search to 1000 and I need more[/color]. One option is to increase the Page size on the Domain Controller but that’s not an option. The other is using PagedResultsControl. I’ve read the documents and examples and it seems like you set a PageSize, create a cookie, and pass the cookie back and forth with the server until it’s null. This should give x number of results per request and continue to iterate through.
The problem is that I just don’t understand Jython and Java enough to know what’s going wrong. My gateway is version 7.5.3 (Windows 2008R2) and when I run the following portion of code:
from java.util import *
from javax.naming import *
from javax.naming.directory import *
from javax.naming.ldap import *
import java.util.Hashtable
import java.util.Enumeration
env = Hashtable()
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory")
env.put(Context.PROVIDER_URL, "ldap://servername:389")
env.put(Context.SECURITY_AUTHENTICATION, "simple")
env.put(Context.SECURITY_PRINCIPAL, "CN=username,OU=Users,DC=domain,DC=com")
env.put(Context.SECURITY_CREDENTIALS, "password")
ctx = InitialLdapContext(env,None)
pageSize = 10
ctxCtls = Control(PagedResultsControl(pageSize,Control.CRITICAL))
ctx.setRequestControls(ctxCtls)
I get the following error:
TypeError: No visible constructors for class (javax.naming.ldap.Control)
I have a feeling this is either something very simple or I’m way over my head with this stuff. I would have given up long ago had it not been so easy to get 1000 results with InitialDirContext.
I understand this may be out of the scope of support on this forum but with the amount of expertise I’ve witnessed while lurking, I’m hoping someone can point me in the right direction. Thank you.
Anthony