Detect if an Active Directory user account is locked using LDAP in Python

后端 未结 7 2257
挽巷
挽巷 2020-12-14 08:53

I\'m validating user logins using python\'s ldap module. When the login fails, I get a ldap.INVALID_CREDENTIALS login, but this can be either because of a wrong password or

7条回答
  •  天命终不由人
    2020-12-14 09:27

    (&(objectClass=user)(&(lockoutTime=*)(!(lockoutTime=0))))

    Will return objects which are users and have a present attribute named lockoutTime which isn't equal to 0.

提交回复
热议问题