Answer the question
In order to leave comments, you need to log in
How to know if a user is a member of a specific LDAP group?
# -*- coding: utf-8 -*-
import win32com.client
query = "<LDAP://DC=DOM,DC=TAN,DC=CORP>;(&(sAMAccountName={0})(objectClass=user));*;subTree".format(curUser)
rs = LDAPConn.Execute(query)[0]
obj = win32com.client.GetObject(rs.Fields(0).Value)
userFIO = obj.Name.split("=")[1]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question