<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem with export Active Directory in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Problem-with-export-Active-Directory/m-p/2464498#M99106</link>
    <description>&lt;P&gt;The first script has 'relief valve' FIRST 1000 which stops the query from returning too many rows at once.&lt;/P&gt;
&lt;P&gt;The code at the bottom is used to pass back the last vale into the select so that the DO loop keeps rolling.&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;AND name&amp;gt;'$(arg)'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you just need to include FIRST 1000 in your second script (same as the first).&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jun 2024 07:51:01 GMT</pubDate>
    <dc:creator>AndyC</dc:creator>
    <dc:date>2024-06-21T07:51:01Z</dc:date>
    <item>
      <title>Problem with export Active Directory</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-export-Active-Directory/m-p/2463048#M99013</link>
      <description>&lt;P&gt;I have the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LET arg=chr(01);	// Set search start name to a very low value
Do 
	ADUsers:
	First 1000		// Workaround for undefined SQL error. Don't forget to sort the entries, so the loop continues
	Load Distinct
		// Add addtional Fields As required
		name As UserName,
		sn As Nachname,
		givenName As Vorname,
		mail As Email,
		telephonenumber As Festnetz,
		mobile As Mobilnummer,
		manager,
		company As Firma,
		department As Abteilung,
		title As Position,
		lastLogonTimestamp As Letzter_Login,
		lastLogon,
		userAccountControl As Status,
		otherPager,
		physicalDeliveryOfficeName as Office
	;
	SQL Select 
		//Fields to select 
		//Add addtional Fields As required
		name, 
		sn,
		givenName,
		distinguishedName,
		mail,
		telephonenumber,
		mobile,
		manager,
		company,
		department,
		title,
		objectCategory,
		objectClass,
		lastLogonTimestamp,
		lastLogon,
		userAccountControl,
		otherPager,
		physicalDeliveryOfficeName
		
	From 
		'LDAP://$(RootDse)'  
	Where 
		objectCategory='person' 
		And objectClass = 'user'  
		And name&amp;gt;'$(arg)'	// Get rows where "name" is GT the arg
	Order by 
		name
	; 
	
	Exit Do When ScriptError &amp;gt; 1	// Stop loop if SELECT has error
	Exit Do When NoOfRows('nameTable') = 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&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works fine! And i have the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LET arg=chr(01);	// Set search start name to a very low value
DO 
	ADGroups:
	LOAD Distinct
		name As GroupName,
		distinguishedName As GroupDN,
		info As GroupInfo
	;
	SQL SELECT 
		name, 
		distinguishedName,
		info
	FROM 'LDAP://$(RootDse)'  
	WHERE objectCategory='group'
		  AND name&amp;gt;'$(arg)' // Get rows where "name" is GT the arg
	Order by 
		name
	;	
	
	EXIT DO WHEN ScriptError &amp;gt; 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&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Here i get the following script error:&lt;/P&gt;
&lt;P&gt;EQ_QVX_SIZELIMIT_EXCEEDED: The size limit for this request was exceeded.&lt;BR /&gt;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 5000 rows.&lt;BR /&gt;ADGroups:&lt;BR /&gt;LOAD Distinct&lt;BR /&gt;name As GroupName,&lt;BR /&gt;distinguishedName As GroupDN,&lt;BR /&gt;info As GroupInfo&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas how I can fix that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:07:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-export-Active-Directory/m-p/2463048#M99013</guid>
      <dc:creator>qlikconsultant</dc:creator>
      <dc:date>2024-06-17T14:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with export Active Directory</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-export-Active-Directory/m-p/2464498#M99106</link>
      <description>&lt;P&gt;The first script has 'relief valve' FIRST 1000 which stops the query from returning too many rows at once.&lt;/P&gt;
&lt;P&gt;The code at the bottom is used to pass back the last vale into the select so that the DO loop keeps rolling.&lt;/P&gt;
&lt;PRE class="lia-code-sample  language-markup"&gt;&lt;CODE&gt;AND name&amp;gt;'$(arg)'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you just need to include FIRST 1000 in your second script (same as the first).&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 07:51:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-export-Active-Directory/m-p/2464498#M99106</guid>
      <dc:creator>AndyC</dc:creator>
      <dc:date>2024-06-21T07:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with export Active Directory</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-export-Active-Directory/m-p/2464511#M99107</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;thanks, I put First 1000 in the code&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LET arg=chr(01);	// Set search start name to a very low value
DO 
	ADGroups:
	First 1000		// Workaround for undefined SQL error. Don't forget to sort the entries, so the loop continues
	LOAD Distinct
		name As GroupName,
		distinguishedName As GroupDN,
		info As GroupInfo
	;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;but same Error message.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 08:18:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-export-Active-Directory/m-p/2464511#M99107</guid>
      <dc:creator>qlikconsultant</dc:creator>
      <dc:date>2024-06-21T08:18:22Z</dc:date>
    </item>
  </channel>
</rss>

