Active directory anr中的两个等号(=)不起作用
我已将以下2个实体添加到我的域中:Active directory anr中的两个等号(=)不起作用,active-directory,ldap,domaincontroller,Active Directory,Ldap,Domaincontroller,我已将以下2个实体添加到我的域中: PS C:\Users\Administrator.LH269> Get-ADUser -LDAPFilter '(anr==leon)' DistinguishedName : CN=Leon1,CN=Users,DC=LH269,DC=com Enabled : True GivenName : Jennifer Name : Leon1 ObjectClass : user
PS C:\Users\Administrator.LH269> Get-ADUser -LDAPFilter '(anr==leon)'
DistinguishedName : CN=Leon1,CN=Users,DC=LH269,DC=com
Enabled : True
GivenName : Jennifer
Name : Leon1
ObjectClass : user
ObjectGUID : 942dd033-6414-471b-b142-77ac954c3d07
SamAccountName : leon-s
SID : S-1-5-21-2040647692-1963463148-3417863429-1151
Surname : Leon
UserPrincipalName : Leon1@LH269.com
DistinguishedName : CN=Leon\, Jennifer,CN=Users,DC=LH269,DC=com
Enabled : True
GivenName : Jennifer
Name : Leon, Jennifer
ObjectClass : user
ObjectGUID : ff0aae88-83ad-4118-a76f-fdd90242ead5
SamAccountName : leon
SID : S-1-5-21-2040647692-1963463148-3417863429-1145
Surname : Leon-Jarama
UserPrincipalName : Leon@LH269.com
当我执行以下查询时:
Get-ADUser -LDAPFilter '(anr==leon)'
我只希望得到一个响应:CN=Leon\,Jennifer,CN=Users,DC=LH269,DC=com
为什么我会得到两个结果?在ANR文档中,当使用ANR==XXX时,明确说明:
You can force ANR to require an exact match on any of the attributes in the table by starting the value with the equal sign, "=" (so the filter has two equal signs)
您可以强制ANR在任何属性上要求精确匹配
这里的关键词是“任何”。这两个帐户都有anr搜索的属性,这些属性与leon完全匹配
Surname : Leon
是的,但姓氏正是里昂,这就是为什么该账户包括在内。姓氏是anr搜索的属性之一。是否可以在anr算法上取消属性或声明特定属性?是的,在下的文档中,但您可以取消选中“模糊名称解析anr”复选框,而不是选中它。但是如果您只想搜索一个或两个属性,您可以通过修改查询以不使用anr来实现这一点。类似这样的内容:| sAMAccountName=leonuserPrincipalName=leonI明白了,可以专门在服务器上设置ANR属性,我不能强制忽略ldap查询本身中的特定ANR属性。这将损害anr算法。。如果我不希望该属性成为ANR属性,我需要在服务器中禁用该属性。。
SamAccountName : leon