努力,补偿浪费的青春!

AD域-用户过滤条件

上一篇 / 下一篇  2017-02-14 16:48:48 / 个人分类:AD

转自:http://www.kejik.com/article/141890.html
查询条件为:
(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))
(&(objectCategory=person)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))

参考资料为:

The format of the LDAP Matching Rule has the following syntax:

attributename : ruleOID := value

where attributename is the LDAPDisplayName of the attribute, ruleOID is the object ID (OID) for the matching rule control, and value is the decimal value you want to use for comparison. You need to convert from hexadecimal to decimal.

The value of ruleOID can be one of the following:

  • 1.2.840.113556.1.4.803 – This is the LDAP_MATCHING_RULE_BIT_AND rule. The matching rule is true only if all bits from the property match the value. This rule is like the bitwise AND operator.
  • 1.2.840.113556.1.4.804 – This is the LDAP_MATCHING_RULE_BIT_OR rule. The matching rule is true if any bits from the property match the value. This rule is like the bitwise OR operator.

An example is when you want to query Active Directory for user class objects that are disabled. The attribute that holds this information is the userAccountControl attribute. This attribute is composed of a combination of different flags. The flag for setting the object that you want to disable is UF_ACCOUNTDISABLE, which has a value of 0x02 (2 decimal). The bitwise comparison filter that specifies userAccountControl with the UF_ACCOUNTDISABLED bit set would resemble this:

(UserAccountControl:1.2.840.113556.1.4.803:=2)
(UserAccountControl:1.2.840.113556.1.4.803:=2)

参考链接:

  • https://support.microsoft.com/en-us/kb/269181
  • https://social.technet.microsoft.com/Forums/windowsserver/en-US/44048e98-b191-4d18-9839-d79ffad86f76/ldap-query-for-all-active-users?forum=winserverDS
  • https://support.google.com/a/answer/6126589?hl=zh-Hans

TAG: 用户

 

评分:0

我来说两句

日历

« 2024-03-29  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 36436
  • 日志数: 28
  • 建立时间: 2016-05-30
  • 更新时间: 2017-02-15

RSS订阅

Open Toolbar