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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
qliksus
Specialist II
Specialist II

Getting the Employeeid from Active directory

Hi all,

im using the following code and macro  to fetch the data from Active directory 

Code:

CONNECT TO
[
  Provider=ADsDSOObject;
  Encrypt Password=False;
  Integrated Security=SSPI;
  Data Source=collercapital.com;
  Mode=Read;
  Bind Flags=0;
  ADSI Flag=-2147483648;
];

SET RootDse = 'DC=CTS, DC=com';

CONNECT TO 'Provider=ADsDSOObject';

LET arg=chr(01);
DO
GroupTable:
LOAD
  name as GroupName,
  distinguishedName as GroupDN
;
SQL select
  name, distinguishedName 
FROM 'LDAP://$(RootDse)'  WHERE objectCategory='group'
  and name='QlikView Experts (Cognizant)';

EXIT DO WHEN ScriptError > 1
EXIT DO WHEN NoOfRows('GroupTable') = 0;
EXIT DO WHEN peek('GroupName') = '$(arg)'; 

LET arg=peek('GroupName');
LOOP


GroupMembers:
LOAD

GroupDN AS GroupKey,
GroupName AS UserGroup,
subfield(GroupMembers(GroupDN), ';') as GroupUser

RESIDENT GroupTable;


/*
Clean up
*/
SET arg=;
SET vUserType=;

Now the macro code is

Function GroupMembers(DN)

Set objItem = GetObject("LDAP://"&DN)

strmember = objItem.GetEx("sAMAccountName")


ret = ""

For Each Item in strmember

ret = ret & Item & ";"

Next

GroupMembers = Left(ret, Len(ret)-1) 'Drop trailing semicolon


End Function

Everthing is working fine but i could not get the employee id  for a particuolar group  i.e the column  GroupUser which is returned

through the macro is not having the employee id  SO please let me know how can take the employee id column

11 Replies
andy
Partner - Creator III
Partner - Creator III

I think my problem of some users doesn't being fetched may have come from some 1500 limit when reading the AD. I turned it the other way around for my specific problem by first fetching the groups and then retrieving their members.

Found some macro from Rob Wunderlich to grab the members it works when run on desktop but not on publisher even though I have checked system access in the file and allow macro and allow unsafe macros on QV 9 server. The user running the publisher is able to reload the document when in desktop.

Now I'm going for the logparser solution....

/Andy

qlikviewforum
Creator II
Creator II

Hi,

The QVW which tries to load the data from LDAP loads only the partial data frequently. We are unable to find the root cause of the issue as the QVW doesn't fails but it loads only the partial data.Can someone please help us to identify the root cause of the issue. It has been happening from quite a long time but we didn't succeed in finding the root cause of the issue. Hope someone can help us for the same.

Regards,

qvforum