When running a ldap search query, I want to return the status of the user within the results. i.e. include a attribute which identifies if the user account is disabled.
this is the filter I am using:
"(&(objectClass=user)(objectCategory=person))"
I've seen examples which allow you to filter out disabled accounts, but I want to return both enabled and disabled accounts but with a flag to identify this status. is it possible?
found the answer if you do a bitwise
(userAccountControl & 2) != 0) // disabled
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With