LDAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesLDAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 23rd, 2004, 07:24 AM
rajds rajds is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 3 rajds User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How to retrieve 100,000 records from Active directory using LDAP/JNDI

Hi....

I want to retrieve nearly 100,000 records from Active directory. But currently I am able to retrieve only 1000 records per search. After 1000th record, it gives LDAP error 4 Maximum Limit Exceeded error..... Can any one throw some light on this issue..... with some working codes

Thanks in advance

raj d.s

Reply With Quote
  #2  
Old November 23rd, 2004, 08:01 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 8,527 pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 1 Day 3 h 19 m 49 sec
Reputation Power: 537
Set up AD as SQLServer's linked server and put everything into a db table, then manipulate there.

Reply With Quote
  #3  
Old November 23rd, 2004, 08:17 AM
rajds rajds is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 3 rajds User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks......

Can you please let me know how to Set up AD as SQLServer's linked server ? Is there any URL for this information...


Thanks in advance

Reply With Quote
  #4  
Old November 23rd, 2004, 08:54 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 8,527 pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level)pabloj User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 1 Day 3 h 19 m 49 sec
Reputation Power: 537
Look at the tutorials link on my signature

Reply With Quote
  #5  
Old August 10th, 2006, 03:41 AM
pritamc pritamc is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 1 pritamc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 59 sec
Reputation Power: 0
Code to retrieve 1000 records

Hai rajds,

I am Pritam working in Java/J2EE. I would be very thankful if you can send me the code to access atleast 1000 records from the Active Directory. I am not able to do that and my sir wants me to do it in 3 days. Please help.


Thanks in advance.



Pritam.

Reply With Quote
  #6  
Old August 10th, 2006, 10:47 AM
Viper_SB's Avatar
Viper_SB Viper_SB is offline
Psycho Canadian
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jan 2001
Location: Canada
Posts: 4,845 Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 20 h 16 m 27 sec
Reputation Power: 634
Quote:
Originally Posted by pritamc
Hai rajds,

I am Pritam working in Java/J2EE. I would be very thankful if you can send me the code to access atleast 1000 records from the Active Directory. I am not able to do that and my sir wants me to do it in 3 days. Please help.


Thanks in advance.



Pritam.
You need to do as pabloj said, OR you can incress the limit of records in the AD config. But only a server admin can change this setting.

Reply With Quote
  #7  
Old August 15th, 2006, 04:35 PM
rnd_man rnd_man is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 2 rnd_man User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 50 sec
Reputation Power: 0
Rajds:

The following quote from MSDN. It may give you some help

The SizeLimit and PageSize properties both affect the number of items that are returned by a search. The SizeLimit property sets the maximum number of items that will be returned by a search, but there may be other search result limitations imposed by the underlying directory service. For example, Active Directory limits the maximum number of search results to 1000. In this case, setting the SizeLimit property to a value greater than 1000 has no effect.

The PageSize property sets the maximum number of items in each page of results that will be returned by a search. The page size is also affected by the underlying directory service. With Active Directory, the largest page size is 1000. Any value over 1000 will be ignored. If PageSize is set to its default value (zero), no paging will occur and the maximum number of items returned by the search will be the lesser of SizeLimit and 1000.

To retrieve a set of results that is larger than 1000 items, you must set SizeLimit to its default value (zero) and set PageSize to a value that is less than or equal to 1000. For example, if a search will result in 12,000 items being returned and SizeLimit is set to 500, a total of 500 items will be returned. If, however, SizeLimit is set to zero and PageSize is set to 500, the search will return all 12,000 results in pages of 500 items, with the last page containing only 200 items. The paging occurs transparently to the application and the application does not have to perform any special processing other than setting the PageSize property to the proper value.

Reply With Quote
  #8  
Old April 12th, 2011, 06:58 AM
Ravi.G.naregal Ravi.G.naregal is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2011
Posts: 1 Ravi.G.naregal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 48 sec
Reputation Power: 0
Quote:
Originally Posted by pritamc
Hai rajds,

I am Pritam working in Java/J2EE. I would be very thankful if you can send me the code to access atleast 1000 records from the Active Directory. I am not able to do that and my sir wants me to do it in 3 days. Please help.


Thanks in advance.



Pritam.


String[] ATTRS = {"uid"};



LDAPSearchConstraints ldapscon = ldapConnection.getSearchConstraints();

try {

ldapscon.setMaxResults(0);

flag = true;

String base = "ou=some,dc=company,dc=in";

//Search to the LDAP Server for given attributes
LDAPSearchResults ldapResultSet = ldapConnection.search(base, LDAPv2.SCOPE_SUB, null, ATTRS, false, ldapscon);

// Loop on results until complete

int count = 1;

//System.out.println("ResultSet Count::"+ldapResultSet.getCount());

while (ldapResultSet.hasMoreElements()) {

flag = false;

LDAPEntry ldapEntry = ldapResultSet.next();

System.out.println("LdapEntry::" + ldapEntry.getDN());

LDAPAttributeSet entryAttributeSet = ldapEntry.getAttributeSet();

Enumeration<LDAPAttribute> attributesInEntry = entryAttributeSet.getAttributes();

while (attributesInEntry.hasMoreElements()) {

LDAPAttribute currenrAttribute = attributesInEntry.nextElement();

Enumeration<String> valsInCurrentAttributes = currenrAttribute.getStringValues();

while (valsInCurrentAttributes.hasMoreElements()) {

String rdn = valsInCurrentAttributes.nextElement();

system.out.println("Rdn----"+rdn);

}

}

}

Ravi

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesLDAP Programming > How to retrieve 100,000 records from Active directory using LDAP/JNDI

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap