LDAP from MacOS

ldapsearch -x -LLL -h 192.168.5.2 -D 'RABOTA\AlexandrM' -w ********* -b"dc=rabota,dc=local" -s sub "(sAMAccountName=AlexandrM)" givenName

To check if account is blocked or not:

ldapsearch -x -LLL -h 192.168.5.2 -D 'RABOTA\AlexandrM' -w $ADP -b"dc=rabota,dc=local" -s sub "(mail=alexeym@rabota.ua)" | grep lockoutTime

If account exists and output is not zero - then it is blocked

whoami

ldapwhoami -h 192.168.5.2 -D 'RABOTA\AlexandrM' -w $ADP