Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
EmmaC
Partner - Creator
Partner - Creator

How to retrieve the users of a specific group in AD (in the LDAP://.... format)?

Dear all,

It is clear how to use the filtering with LDAP (in Sense), but how to retrieve the users of a group in QlikView QMC using the LDAP://... format? (Directory Service Connectors->DSC@company->Active Directory)

LDAP://company.local/DC=company,memberOf=Qlikies,OU=Meine Gruppen,DC=Local

Thanks for you help,

kind regards,

Emma

3 Replies
Anonymous
Not applicable

Try PGAdmin tool and query the Repository please.

maksim_senin
Partner - Creator III
Partner - Creator III

Hi Emma,

Please find the script I use for loading from LDAP, I hope it will help you. I added FIRST 1000 due to errors when I try loading more records.

SET RootDse = 'LDAP://host.name:port';

CONNECT TO [Provider=ADsDSOObject;Encrypt Password=False;Data Source=LDAP://host.name:port;Mode=Read];

LET arg=chr(01);

DO

  ADUsers:

  FIRST 1000

  LOAD DISTINCT

  cn,

  sAMAccountName as Login,

  name as UserName

  ;

  SQL select

  cn,

  sAMAccountName,

  name

  FROM '$(RootDse)'

  WHERE

  objectCategory='person' AND

  objectClass = 'User' 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('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

Not applicable

Hi

I found out that there is a max number of records you can select with loading from LDAP, which is exactly 1000. Thus, if you miss any users, you will need to duplicate/triplicate the whole Loop as many times until all of the LDAP data has been loaded.

It's not nice coding, but it works 🙂

Otherwise when not setting the Limit of FIRST 1000 the script throws an error QVX_UNEXPECTED_END_OF_DATA.

Kind regards,

Chris