Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
vitaliichupryna
Creator III
Creator III

Load Data from AD

Hi,

I try to load data from AD for this I use script that was created by Rob Wunderlich, every time I run it I received issue:

EQ_QVX_SIZELIMIT_EXCEEDED: The size limit for this request was exceeded. This query was stopped because it tried to read beyond a restricted limit. One of the tables in the query has a limit of maximum 1000 rows.

Is there a way to increase this limit?

Example of the script:

LET arg=chr(01); // Set search start name to a very low value
DO
ADUsers:
//FIRST 1000 // Workaround for undefined SQL error.
LOAD DISTINCT
// Add addtional Fields as required
name as UserName,
distinguishedName as UserDN
;
SQL select
// Add addtional Fields as required
name, distinguishedName // Fields to select
FROM 'LDAP://$(RootDse)' WHERE objectCategory='person'
AND name>'$(arg)'
order by name; // Get rows where "name" is GT the arg

EXIT DO WHEN ScriptError > 1 // Stop loop if SELECT has error
EXIT DO WHEN NoOfRows('ADUsers') = 0; // Stop loop if SELECT returns nothing
EXIT DO WHEN peek('UserName') = '$(arg)'; // If the last "name" read is EQ to arg -- no more entries

LET arg=peek('UserName'); // Set the arg to the last "name" read
LOOP

Labels (1)
2 Replies
NadiaB
Support
Support

Hi @vitaliichupryna 

Please refer to the following article:

Error "QVX_UNEXPECTED_END_OF_DATA" when loading data with ADsDSOObject

Kind Regards.

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Shisho_Karsenty
Contributor III
Contributor III

Another solution:

TempTbl:
Load * Inline [
letter,letter_id
a,1
b,2
c,3
d,4
e,5
f,6
g,7
h,8
i,9
j,10
k,11
l,12
m,13
n,14
o,15
p,16
q,17
r,18
s,19
t,20
u,21
v,22
w,23
x,24
y,25
z,26
];


Set v_letter_id = 0;
LET v_letter = Peek('letter',$(v_letter_id),'TempTbl');
Trace $(v_letter);

Do while v_letter_id < 26
    LET v_letter = Peek('letter',$(v_letter_id),'TempTbl');
    Trace Loading all users beginning with the letter: $(v_letter);

    RAW_ActiveDirectory:
	SQL SELECT
		employeeNumber,
		employeeID,
		department,
		employeeType,
		givenName,
		mail,
		manager,
		mobile,
		pager,
		sn,
		sAMAccountName,
		telephoneNumber,
		title,
		userAccountControl,
		displayName,
		physicalDeliveryOfficeName
	FROM 'LDAP://YOUR_SERVER_NAME'
        WHERE objectCategory='user' and objectClass='user' 
	AND sAMAccountName = '$(v_letter)*';   

	Let v_letter_id = v_letter_id + 1;
    
Loop

 Works for me😊