Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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.