简体   繁体   中英

How to fetch user who are disabled in LDAP active directory

我必须编写Java代码来查找活动目录中的特定用户是启用还是禁用。

You can inspect the userAccountControl bit flag attribute. Its 2nd bit indicates if a user is disabled (see the Remarks section on the attribute's MSDN page .)

The easiest is to use a bitwise filter in your LDAP query:

(userAccountControl:1.2.840.113556.1.4.803:=2)

This filter expression will return only disabled accounts (see more on the usage of bitwise filters in this article ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM