Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Acessar dados do AD

Senhores,

Preciso acessar os dados do AD para uma aplicação de Help Desk. Já vi um exemplo (USA) de acesso mas não funcionou, principalmente na configuração do LDAP.

Alguém tem alguma experiência positiva neste intento?

Abraço.

1 Solution

Accepted Solutions
Not applicable
Author

Olá Maurilio,

Você deve criar uma conexão OLE DB conforme imagens abaixo.

Segue o exemplo que tenho em um cliente.


CONNECT TO [Provider=ADsDSOObject;User ID=Dominio\Usuario;Encrypt Password=False;Data Source=LDAP://dominio.com.br;Mode=Read;Bind Flags=0;ADSI Flag=-2147483648] (XPassword is OaSBcZVMODaCGUD);

//************* Grupos AD ****************//
FOR each arg in 'g-bal-pub-QlikviewNA','g-usr-qlikview-CA-consulta','g-usr-qlikview-FI-consulta','g-bal-pub-qlikview'

Groups:
LOAD
distinguishedName as GroupKey,
cn as Grupo;
SQL select
distinguishedName,
cn
FROM 'LDAP://DC=dominio,DC=com, DC=br'
WHERE objectCategory='group' AND cn ='$(arg)';

store Groups into $(metaPath)\Groups_$(arg).qvd;

LET vGK = peek('GroupKey');
TRACE GRUPO - $(arg) - $(vGK);
Users:
LOAD
'$(vGK)' as GroupKey,
upper(sAMAccountName) as LanID_2,
upper(sAMAccountName) as Matricula,
cn as Name;
SQL SELECT
sAMAccountName,
cn
FROM 'LDAP://DC=dominio,DC=com, DC=br'
WHERE memberOf='$(vGK)';

store Users into $(metaPath)\Users_$(arg).qvd;

drop table Users;
drop table Groups;
NEXT arg


View solution in original post

1 Reply
Not applicable
Author

Olá Maurilio,

Você deve criar uma conexão OLE DB conforme imagens abaixo.

Segue o exemplo que tenho em um cliente.


CONNECT TO [Provider=ADsDSOObject;User ID=Dominio\Usuario;Encrypt Password=False;Data Source=LDAP://dominio.com.br;Mode=Read;Bind Flags=0;ADSI Flag=-2147483648] (XPassword is OaSBcZVMODaCGUD);

//************* Grupos AD ****************//
FOR each arg in 'g-bal-pub-QlikviewNA','g-usr-qlikview-CA-consulta','g-usr-qlikview-FI-consulta','g-bal-pub-qlikview'

Groups:
LOAD
distinguishedName as GroupKey,
cn as Grupo;
SQL select
distinguishedName,
cn
FROM 'LDAP://DC=dominio,DC=com, DC=br'
WHERE objectCategory='group' AND cn ='$(arg)';

store Groups into $(metaPath)\Groups_$(arg).qvd;

LET vGK = peek('GroupKey');
TRACE GRUPO - $(arg) - $(vGK);
Users:
LOAD
'$(vGK)' as GroupKey,
upper(sAMAccountName) as LanID_2,
upper(sAMAccountName) as Matricula,
cn as Name;
SQL SELECT
sAMAccountName,
cn
FROM 'LDAP://DC=dominio,DC=com, DC=br'
WHERE memberOf='$(vGK)';

store Users into $(metaPath)\Users_$(arg).qvd;

drop table Users;
drop table Groups;
NEXT arg