Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

elbertfjr22
New Contributor III

Get the userName from Active Directory with filtering by domain group on QV script. Possible?

Hi Guys,

From QlikView script, has anyone been able to successfully extract the userNames from Active Directory with filtering by domain group? (Example, I wan't only to get the userNames of users that belong to QlikViewUsers domain group.) Is this even possible?

I am able to get the the userNames using the CONNECT TO 'Provider=ADsDSOObject'; but my filtering is limited to objectClass or objectCategory only. I also found out that the userName and domainGroup is saved in the same field (cn or name), so even I filter the objectCategory to 'person' or 'group', there were no association between the two.

Thanks!!!

Elbert

3 Replies
Not applicable

Get the userName from Active Directory with filtering by domain group on QV script. Possible?

Hi Elbert,

I've used recently the following script for do something like yours:


CONNECT TO [Provider=ADsDSOObject;Encrypt Password=False;Integrated Security=SSPI;Data Source=LDAP;Location=192.168.10.10;Mode=Read;Bind Flags=0;ADSI Flag=-2147483648];
ldap:
SQL SELECT displayName
FROM 'LDAP://DC=MyCompany, DC=com'
WHERE objectCategory = 'Person' AND objectClass = 'user' AND memberOf= 'CN=QlikViewUsers,OU=GLOBAL,OU=SECURITY,OU=GRUPS,OU=MADRID,OU=C.MADRID,OU=SPAIN,OU=EUROPE,DC=MyCompany,DC=com';


I hope it helps you.

Regards.

elbertfjr22
New Contributor III

Get the userName from Active Directory with filtering by domain group on QV script. Possible?

Hi Miguel,

Thanks for your reply. But I still not able the extract the data that I wanted. I will be asking you few more questions. Thanks for your patience.

On your filtering for memberOf, where can I find values for OU? On your sample you put OU=C.MADRID, OU=SPAIN, etc. I removed this part on my script and I'm not extracting any data.

Also if I remove the WHERE condition altogether and add memberOf field in the fields I want to extract, I'm getting a null value on the memberOf field. The name, cn, dispalyName, objectCategory fields are ok, I can get all the values.

I tested this on 3 different domains already and I getting same result.

Again, thanks.

Elbert

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

ldap:
SQL SELECT
displayName,
name,
cn,
memberOf
FROM 'LDAP://DC=ElbertDomain, DC=Local'
WHERE objectCategory = 'Person' AND objectClass = 'user';
// AND memberOf = 'CN=QVUsers,OU=GLOBAL,OU=SECURITY,OU=GRUPS,DC=ElbertDomain,DC=Local';

Exit script;

Not applicable

Get the userName from Active Directory with filtering by domain group on QV script. Possible?

Hi Elbert,

The UO is Organizational unit, if you don't know waht is the appropriate, you could execute the following sentence and find any user who belongs into the group what are you looking for, the distinguishedName field will give you what you need for making the right query.


ldap:
SQL SELECT displayName, distinguishedName
FROM 'LDAP://DC=ElbertDomain, DC=com'
WHERE objectCategory = 'Person' AND objectClass = 'user';


I hope it helps you.

Regards.

Community Browser