LDAP Filter Syntax
This topic deals with the syntax and rules for an LDAP filter, which is a normal string which expresses the criteria for the filter. You need knowledge about LDAP filters if you want to search objects and filter objects in the LDAP browser LEX.
You can get even more information about LDAP filters in the SelfADSI scripting Tutorial article about LDAP filters.
Basic LDAP Filter Syntax and Operators
LDAP filters consist of one or more criteria. If one than more criterion exist in one filter definition, they can be concatenated by logical AND or OR operators. The logical operators are always placed in front of the operands (i.e. the criteria). This is the so-called 'Polish Notation'.
The search criteria have to be put in parentheses and then the whole term has to be bracketed one more time.
AND Operation:
(& (...K1...) (...K2...)) or with more than two criteria: (& (...K1...) (...K2...) (...K3...) (...K4...))
OR Operation:
(| (...K1...) (...K2...)) or with more than two criteria: (| (...K1...) (...K2...) (...K3...) (...K4...))
Nested Operation:
Every AND/OR operation can also be understood as a single criterion:
(|(& (...K1...) (...K2...))(& (...K3...) (...K4...))) means: (K1 AND K2) OR (K3 AND K4)
The search criteria consist of a requirement for an LDAP attribute, e.g. (givenName=Sandra). Following rules should be considered:
Equality: | (attribute=abc) , e.g. (&(objectclass=user)(displayName=Foeckeler) |
Negation: | (!(attribute=abc)) , e.g. (!objectClass=group) |
Presence: | (attribute=*) , e.g. (mailNickName=*) |
Absence: | (!(attribute=*)) , e.g. (!proxyAddresses=*) |
Greater than: | (attribute>=abc) , e.g. (mdbStorageQuota>=100000) |
Less than: | (attribute<=abc) , e.g. (mdbStorageQuota<=100000) |
Proximity: | (attribute~=abc) , e.g. (displayName~=Foeckeler) Caution: ~= is treated as = in ADS environments !! |
Wildcards: | e.g. (sn=F*) or (mail=*@cerrotorre.de) or (givenName=*Paul*) |
Further rules:
Real attributes only | Only standard attributes can be used for LDAP filters. When specifying an LDAP search filter, you cannot use object properties of the ADSI objects that aren't LDAP database attributes but interface properties of the regarding object. A list of the affected properties can be viewed in the SelfADSI Scripting Tutorial under the topic 'Object Properties of ADSI Objects'. |
||||||||||||||||||||||||||||||||
No quotation marks | Comparative strings do NOT appear in quotation marks. A filter for the displayName 'Philipp Foeckeler' would read as follows: (displayName=Philipp Foeckeler). |
||||||||||||||||||||||||||||||||
Upper/lower case | If you want to filter boolean attributes the consideration of the upper/ lower case will be crucial. The use of TRUE or FALSE is absolutely necessary for filtering such booleans. However, most other string attributes are case-insensitiv, i.e. a hit will be found even if the upper and lower case differs from your search filter. Especially in Exchange 5.5 directories most of the attributes are case sensitive. There are only few exceptions which can be viewed under the SelfADSI Scripting Tutorial topic 'Directory Attributes with CaseIgnoreString Syntax'. |
||||||||||||||||||||||||||||||||
DN-String attributes | Regarding match algorithms of LDAP filters, LDAP directory systems comply with the specifications of the original X.500 standards. According to these matching rules you can't use wildcards in LDAP filters for attributes containing LDAP distinguished names (attributes with DN-string syntax / ADSI attribute data type ADSTYPE_DN_STRING = 1). The same applies for ADS: Filters in which DN attributes are searched with wildcards do not work. This can be quite irritating. You can't e.g. search for all users that are members in groups that contain a certain string in their group names. The reason for this is that the user attribute memberOf has the data type DN-string. Even more important could be the search for objects in a specific OU. Especially, when only the declaration of a pure filter string is allowed and when there is no possibility to specify the search base of an LDAP search. This might well be so e.g. for the definition of recipient policies in Microsoft Exchange environments. Thus, the following filter won't work! (distinguishedName=*,ou=Sydney,dc=cerrotorre,dc=org) In this case we have to use a script-based solution which provides a workaround for this LDAP filter limitation. |
||||||||||||||||||||||||||||||||
Special characters | LDAP filters can be specified by unicode characters. You may, for example, use German umlauts - if it makes sense (if the filtered attribute is an unicode string). However, the characters ( ) & | = ! > < ~ * / \ play a special role for the declaration of LDAP filters. If you search for or want to compare these characters within an attribute string, you'll have to use a prefixed backslash and the corresponding hexadecimal ASCII code:
An example: We want to retrieve all objects whose attributes "displayName" start with "*" : (displayName=\2a) The character zero (\00) may also be required occasionally. |
||||||||||||||||||||||||||||||||
Multivalued attributes.... | It's also possible to filter for certain values in multivalue attributes. An example is the attribute objectClass. Due to the hierarchical structure of the directory schema, an object will always be an instance of several object classes. An ADS user e.g. is an object of the class types top, person, organizationalPerson und user. Thus, a filter could be: (objectClass=user) However, you need to take into consideration that such filtering always costs more server performance than an ordinary 'one-dimensional' attribute search does. |
Filtering for Hex Numbers and Binary Values
Hex Numbers | In cases where attributes of the type integer or long integer are compared and filtered for specific hex numbers, the correspondent decimal coded number has always to be used in the LDAP filter. An example: If you look for local security groups in the ADS following two flags will have to be set for the groupType attribute: ADS_GROUP_TYPE_LOCAL_GROUP (0x00000004) ADS_GROUP_TYPE_SECURITY_ENABLED (0x80000000) The addition of these values is the hex value 0x80000004, calculated in the decimal number 2147483652 - this has to be used in the LDAP filter: (groupType=2147483652) |
Binary Values | It's a completely different thing if you want to compose filters for attributes whose data types appear as binary hex values (the according data type is often referred to as 'Octet String'). If you are going to filter for such binary attributes, it is mandatory to declare every single byte that has to be compared in hex code. For instance, if you search for objects with the attribute 'Inventory' which has the value 0x01AAF5EF, then the appropriate filter will have to read: (Inventory=\01\aa\f5\ef) Unfortunately, wildcard search is not allowed when searching for binary attributes! |
Filtering for Bit Fields
By using LDAP filters it's also possible to find objects for which a specific bit either is or is not set within a bit field. In this case, an strange looking syntax has to be followed:
<Attribute name>:<BitFilterRule-ID>:=<decimal comparative value>
There are exactly two BitFilterRule IDs: One for bit-wise AND comparisons and one for bit-wise OR comparisons:
LDAP_MATCHING_RULE_BIT_AND 1.2.840.113556.1.4.803
LDAP_MATCHING_RULE_BIT_OR 1.2.840.113556.1.4.804
An example:
For the attribute 'groupType' following bit mask is important in ADS group objects:
ADS_GROUP_TYPE_GLOBAL_GROUP = 0x00000002
ADS_GROUP_TYPE_LOCAL_GROUP = 0x00000004
ADS_GROUP_TYPE_UNIVERSAL_GROUP = 0x00000008
ADS_GROUP_TYPE_SECURITY_ENABLED = 0x80000000
A filter for universal groups has to search for those objects in whose attributes the 4th least significant bit is set. This can be checked by equating the attribute of the value 0x00000008 (this represents the 4th bit) in an AND filter:
(groupType:1.2.840.113556.1.4.803:=8)
Caution: In LDAP filters the hex value of the bit filter must be decimal at this point! So if all security groups (and not the distribution groups) are to be found, it has to be filtered for the 8th bit (0x80000000 = 2147483648):
(groupType:1.2.840.113556.1.4.803:=2147483648)
An example for an OR filter: We search all users which don't need a password (userAccountControl is set on 0x20 - 32) or whose passwords never expires (userAccountControl is set on 0x10000 = 65536). So we have to build a filter with the value 65568 (=65536 + 32):
(userAccountControl:1.2.840.113556.1.4.804:=65568)
Please note that bit-wise filtering is a much more complex procedure for a server. For this reason you should take into consideration the use of normal equity criteria. If looking e.g. for universal security groups, the two flags 0x80000000 and 0x00000008 can be added up and then be filtered for the according decimal value 2147483656:
(groupType=2147483656)
Please note that the LEX dialogs for editing LDAP Filters let's you set such bitmap filter syntaxes very easily.
Filtering with Ambiguous Name Resolution (ANR)
The Ambiguous Name Resolution is able to find users or contacts in Active Directory environments whose names are only partly known. In this case not only the object name but also the display name, first and last name as well as the diverse mail addresses are involved in the search. As an Outlook user you can have a look at the ANR filtering search by using e.g. the option 'Check names' for getting the best hit while searching for an address.
Which attributes are integrated exactly in the ANR search is specified by the attribute search flags in the directory schema. By doing so, a so-called ANR set of attributes is declared. Following attributes are part of the ANR set by default:
- Relative Distinguished Name (RDN), this could be for example the values for cn=.... or ou=...
- givenName (first name)
- sn (last name)
- displayName (display name)
- legacyExchangeDN (after migrations the Exchange 5.5 directory name of the old mailbox is shown here)
- proxyAddresses (mail addresses)
- physicalDeliveryOfficeName (office address)
The syntax of ANR filters is as follows:
(anr=Philipp) or (anr=p f) or (anr=Foeck)
All these filters would find the user 'Foeckeler, Philipp'. The second one is able to find 'Philipp Foeckeler' as well as 'Fritz Paul'. This is because the ANR filter checks the first name and last name in both directions.
相关推荐
基于MATLAB的轴承润滑方程数值求解仿真:偏位角修正与刚度阻尼的扰动法分析,基于Matlab的轴承润滑方程数值求解仿真研究:偏心率影响下的油膜压力及刚度阻尼扰动法分析。,张直明书,基于matlab的轴承的润滑方程进行数值求解仿真,改变偏心率,可求输出不同参数下的油膜压力,并可以进行偏位角的修正,扰动法求得刚度阻尼。 ,关键词:张直明书;MATLAB;轴承润滑方程;数值求解仿真;偏心率;油膜压力;偏位角修正;扰动法刚度阻尼。,MATLAB仿真:轴承润滑方程数值求解及参数影响分析
2024免费毕业设计成品,包括源码+数据库+往届论文资料,附带启动教程和安装包。 启动教程:https://www.bilibili.com/video/BV1jKDjYrEz1 技术栈:Vue.js+SpringBoot+MySQL。 开发工具:Idea+VSCode。
光伏交直流混合微电网的离网孤岛模式双下垂控制Matlab Simulink仿真模型设计与研究:以10kW直流微电网和15kW交流微电网的协同工作为核心,光伏交直流混合微电网系统双下垂控制Matlab Simulink仿真模型:孤岛模式下离网运行与策略分析,光伏交直流混合微电网离网(孤岛)模式双下垂控制Matlab Simulink仿真模型 交直流混合微电网结构: 1.直流微电网,由光伏板+Boost变器组成,最大输出功率10 kW。 2.交流微电网,由光伏板+Boost变器+LCL逆变器组成,最大输出功率15 kW。 3.互联变器(ILC),由LCL逆变器组成,用于连接交直流微电网。 模型内容: 1.直流微电网采用下垂控制,控制方式为电压电流双闭环,直流母线额定电压700 V。 2.交流微电网中,Boost变器采用恒压控制,直流电容电压为700 V,LCL逆变器采用下垂控制,额定频率50 Hz,额定相电压有效值220 V。 3.ILC采用双下垂控制策略,首先将交流母线频率和直流母线电压进行归一化,使其范围控制在[-1,1],之后通过ILC的归一化下垂控制调节交流母线频率和直流母线电压的
基于光伏三相并网技术的MPPT控制与SPWM调制策略的仿真研究与应用,光伏三相并网仿真研究:MPPT控制下的两级式逆变器与LCL滤波性能分析,光伏三相并网仿真 模型内容: 1.光伏+MPPT控制+两级式并网逆变器(boost+三相桥式逆变) 2.坐标变+锁相环+dq功率控制+解耦控制+电流内环电压外环控制+spwm调制 3.LCL滤波 仿真结果: 1.逆变输出与三项380V电网同频同相 2.直流母线电压600V稳定 3.d轴电压稳定311V;q轴电压稳定为0V,有功功率高效输出 相关参考。 ,核心关键词:光伏三相并网仿真; MPPT控制; 两级式并网逆变器; 坐标变换; 锁相环; dq功率控制; 解耦控制; 电流内环电压外环控制; spwm调制; LCL滤波; 逆变输出; 三相电网同频同相; 直流母线电压稳定; d轴电压稳定; q轴电压稳定; 有功功率输出。,光伏系统LCL滤波下的三相并网仿真模型与高效功率输出研究
学生心理健康情绪管理培训PPT
欧姆龙NX1P与三菱FX5U的Modbus TCP通讯实战:基于MTCP库的功能块开发与运用,欧姆龙NX1P与三菱FX5U的Modbus TCP通讯实战:基于MTCP库的功能块开发与运用,欧姆龙NX1P与三菱FX5U modbus tcp通讯案例 MTCP库介绍 NJ NX并不支持ModbusTCP协议,库文件是在socket的基础上开发出来的功能块。 库文件共有10个功能块,根据不同的功能块实现不同的modbusTCP的功能(版本不一样,有的库文件内的功能块数量只有6个)。 10个功能块分别为客户端使用9个功能块,客户端连接、读线圈、读输入寄存器、读保持寄存器、写单个线圈、写单个保持寄存器、写多寄存器;服务器使用一个功能块。 ,欧姆龙NX1P; 三菱FX5U; Modbus TCP通讯; MTCP库; 功能块; 客户端使用功能块; 服务器使用功能块,欧姆龙与三菱Modbus TCP通讯案例及MTCP库介绍
基于Matlab的复杂环境车牌识别系统:夜间雾霾天气下的智能识别与处理解决方案,基于Matlab的复杂环境车牌识别系统:夜间雾霾天气下的智能识别与处理解决方案,基于matlab的雾霾天气+夜间车牌识别系统 【车牌识别】基于计算机视觉,数字图像处理常见实战项目:雾霾天气及夜间车牌识别+语音播报+GUI显示+车牌信息导出。 含GUI界面。 预处理过程:去雾增强算法,亮度增强算法。 车牌处理过程:车牌粗定位,灰度化,倾斜矫正,二值化,形态学处理,反色处理、精准定位,分割识别,语音播报,车牌信息结果导出。 文件包含:完整程序文件,GUI界面源文件, 白天、雾霾天气、夜间汽车图像数据集及字符模版库文件,语音播报的语音文件,车牌信息文本文件。 代码结构清晰,含有注释,运算速度快,可扩展。 视频,可出报告,PPT等(第005期) ,基于Matlab; 雾霾天气车牌识别; 夜间车牌识别; 图像预处理; 计算机视觉; 数字图像处理; GUI界面; 程序文件; 数据集; 代码结构。,基于Matlab的雾霾夜间车牌识别系统设计与实现
本项目是自己做的设计,有GUI界面,完美运行,适合小白及有能力的同学进阶学习,大家可以下载使用,整体有非常高的借鉴价值,大家一起交流学习。该资源主要针对计算机、通信、人工智能、自动化等相关专业的学生、老师或从业者下载使用,亦可作为期末课程设计、课程大作业、毕业设计等。 项目整体具有较高的学习借鉴价值!基础能力强的可以在此基础上修改调整,以实现不同的功能。
Simulink虚拟同步机VSG控制模型研究:离网运行储能构网型控制策略及优化,Simulink虚拟同步机仿真模型VSG控制:储能离网与构网型控制的深入研究(基于2018b版本),Simulink同步机仿真模型VSG控制离网运行储能构网型控制 模型直流侧可以替为储能电池,研究储能离网VSG控制;其他地方也可以改进模型,研究并网VSG,多台VSG并离网,组合控制等,构网型控制现在比较热门。 默认2018b版本。 ,Simulink; 虚拟同步机仿真模型; VSG控制; 离网运行; 储能构网型控制; 直流侧替换; 储能离网VSG控制; 并网VSG; 多台VSG并离网; 组合控制。,Simulink虚拟同步机模型:离网与构网型控制研究与实践(2018b版)
本项目是自己做的设计,有GUI界面,完美运行,适合小白及有能力的同学进阶学习,大家可以下载使用,整体有非常高的借鉴价值,大家一起交流学习。该资源主要针对计算机、通信、人工智能、自动化等相关专业的学生、老师或从业者下载使用,亦可作为期末课程设计、课程大作业、毕业设计等。 项目整体具有较高的学习借鉴价值!基础能力强的可以在此基础上修改调整,以实现不同的功能。
本资料围绕企业架构概述、企业架构元模型、企业架构视图、企业架构管控等方面来阐述企业架构及典型设计。
锂离子电池恒流恒压充电(CC-CV)Simulink仿真模型详解 该模型涵盖直流电压源、DC DC变换器、电池及CCCV控制系统。附2000字说明文档和参考文献,详细解析恒流与恒压充电过程,助你快速掌握电池充电技术。,锂离子电池恒流恒压充电(CC-CV)Simulink仿真模型解析与实现指南:含电路结构、充电过程详解及丰富文献资料,锂离子电池恒流恒压充电Simulink仿真模型(CC-CV) 电路结构包括:直流电压源、DC DC变器、锂离子电池、CCCV控制系统 [hot]赠送2000多字的说明文档和参考文献,帮助您更快理解 恒流恒压充电过程: [1]在CC阶段对电池施加恒定电流,以获得更快的充电速度,此时电池电压持续升高,经过一段时间后达到预设的最大电压,但是由于极化的存在,充电过程中测量的电池电压要大于实际的电池电压;所以还需要进入CV阶段继续充电 [2]在CV阶段电压保持恒定,电流呈指数级下降,极化电压逐渐降低,测量的电池电压更加接近于电池真实电压,当充电电流减小到一定值或SOC升高到一定值时,可以认为电池已经完全充电。 ,关键词:锂离子电池;恒流恒压充电;Simulink仿
永磁同步电机PMSM矢量控制仿真模型:负载波动下的稳定转速电流跟随与SVPWM实现原理详解,永磁同步电机PMSM矢量控制仿真模型:助力新人快速掌握转速与电流控制,理解SVPWM原理,带位置传感器仿真指导,参数计算精准便捷,永磁同步电机PMSM矢量控制仿真,该模型可以指导新人快速入门,了解各个控制环节的波形及搭建方法。 波形见附图,可见在负载波动情况下转速及电流跟随稳定; 模型可助于理解转速及电流环路设计; 模型可助于理解svpwm实现原理; 模型内提供参数计算方法,不用经验值整定; 带位置传感器矢量控制仿真; 可以简单; ,关键词:永磁同步电机; 矢量控制仿真; 波形; 负载波动; 转速; 电流环路设计; SVPWM实现原理; 参数计算方法; 位置传感器。,PMSM矢量控制仿真模型:轻松理解SVPWM与位置传感控制,快速入门之必备工具
本项目是自己做的设计,有GUI界面,完美运行,适合小白及有能力的同学进阶学习,大家可以下载使用,整体有非常高的借鉴价值,大家一起交流学习。该资源主要针对计算机、通信、人工智能、自动化等相关专业的学生、老师或从业者下载使用,亦可作为期末课程设计、课程大作业、毕业设计等。 项目整体具有较高的学习借鉴价值!基础能力强的可以在此基础上修改调整,以实现不同的功能。
deepseek全套教程(近40多个教程),包含deepseek介绍、部署教程、使用教程、使用技巧、使用手册,包含热门教程《DeepSeek从入门到精通(清华大学新闻与传播学院新媒体研究中心出品)104页》和《DeepSeek中小学生使用手册》等。
内容概要:本文介绍了某大型央企在其数字化转型过程中的战略规划及实施方法。首先探讨了企业当前存在的数字化痛点,包括数据‘孤岛’、业务流程自动化程度低、人才短缺等问题,并提出了针对性的解决方案。通过建设数据治理体系、搭建企业架构和推进相关技术应用,该公司旨在增强数据管理能力,促进各部门间的协同工作,以及通过数字化手段来提高整体运营效率和服务质量。具体实践中还包括建立了若干数字化平台和系统来支持特定业务领域(如营销、生产管理)的优化。同时介绍了其他企业在类似背景下成功实施的经验案例,特别是来自工程机械行业的数字化转型故事以及公司的数字化架构设计。 适用人群:适用于希望深入了解制造业尤其是国有企业在数字化转型领域的管理者、IT专业人员以及其他对企业信息化有兴趣的研究者。 使用场景及目标:① 作为国有企业或大型企业的参考材料,用于规划自身的数字化转型路线;② 提供给管理层作为决策支持文档,帮助理解数字化转型的重要性和实践路径;③ 为企业内训或外部研讨会的内容素材,传播最新的数字化理念和技术方案。 其他说明:文章提供了大量的图表和实际操作指南,有助于读者更加直观地理解企业应该如何开始和持续推进这一重要的战略性举措。此外,文中多次提及需结合自身特点和发展需求,制定个性化的实施方案。
班级同学录网站
几何相位超表面全息显示技术:基于S参数分析、偏振转换与GS迭代算法的透反射相位精确计算与应用,几何相位超表面全息显示技术:基于S参数分析、偏振转换与GS迭代算法的透反射相位精确计算与应用,几何相位超表面全息显示; - 复现: 2015年nature nanotechnology; - 关键词: 超表面, 几何相位, 全息, GS迭代算法, S参数分析组, 透反射系数与相位计算与补偿, 偏振转; - 软件: FDTD; - 备注: 可分三块 - 基于S参数分析组的透反射相位精确计算 150; - 偏振转 100; - 基于GS迭代的纯相位全息显示 250; ,超表面; 几何相位; 全息显示; GS迭代算法; S参数分析组; 透反射计算与补偿; 偏振转换; FDTD软件; 透反射相位计算; 偏振转换计算; 全息显示技术,基于几何相位超表面的全息显示技术:复现与软件分析方法研究
COMSOL模拟:单场耦合下的注二氧化碳驱替甲烷模型研究,COMSOL模型中二氧化碳驱替甲烷效应的单一气体驱替模型研究:不考虑多场耦合影响,COMSOL 注二氧化碳驱替甲烷模型 没有考虑多场耦合 只考虑了气体的驱替效应 ,COMSOL;二氧化碳驱替甲烷模型;未考虑多场耦合;仅考虑气体驱替效应;,COMSOL模拟注二氧化碳驱替甲烷模型:单一气体驱替效应研究
企业客服培训