Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ingridmerx
Contributor III
Contributor III

Question to Rob Wunderlich about extracting data AD

Hello Rob,

I am having troubles with the script to extract data from the active directory (the famous QVX_UNEXPECTED_END_OF_DATA: error).

I think something is wrong with de content of the data and I am trying to find out what and where.

I am very new at scripting (and Qlikview). Could you explain to me what is achieved with Let arg=chr(01) (in your script below)?

CONNECT TO 'Provider=ADsDSOObject';

LET arg=chr(01);     // Set search start name to a very low value
DO
ADGroups:
LOAD
name as GroupName,
distinguishedName as GroupDN,
info as GroupInfo
;
SQL select
name, distinguishedName,
info
FROM 'LDAP://$(RootDse)'  WHERE objectCategory='group'
AND name>'$(arg)';  
// Get rows where "name" is GT the arg
    
EXIT DO WHEN ScriptError > 1   // Stop loop if SELECT has error
     EXIT DO WHEN NoOfRows('nameTable') = 0;  // Stop loop if SELECT returns nothing
     EXIT DO WHEN peek('GroupName') = '$(arg)';  // If the last "name" read is EQ to arg -- no more entries
    
LET arg=peek('GroupName');     // Set the arg to the last "name" read
LOOP

1 Solution

Accepted Solutions
ingridmerx
Contributor III
Contributor III
Author

Hello,

I solved it myself. The trouble with the script was the limit of 1000 records. I adjusted this to FIRST 901 as suggested in another post.

View solution in original post

1 Reply
ingridmerx
Contributor III
Contributor III
Author

Hello,

I solved it myself. The trouble with the script was the limit of 1000 records. I adjusted this to FIRST 901 as suggested in another post.