AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 887553
Accepted
Mike B
Mike B
Asked: 2017-12-12 08:50:43 +0800 CST2017-12-12 08:50:43 +0800 CST 2017-12-12 08:50:43 +0800 CST

是否允许使用带空格的分号作为 Active Directory DirectoryString 属性值的分隔符?

  • 772

我有一个第三方 Web 应用程序正在运行 LDAP 查询以查找用户的电子邮件地址是否存在于 AD 中。查询如下所示:

(&(objectClass=user)(proxyAddresses=SMTP:[email protected])) 

我proxyAddresses在 AD 中的属性值如下所示:

X500:/o=foo/ou=foo Group (ABC123)/cn=Foo3/cn=foouser (blah)123; SIP:[email protected]; smtp:[email protected]; smtp:[email protected]; SMTP:[email protected]

Web 应用程序正在返回空结果。当我使用 AD Explorer 检查时,我看到了类似的结果。此外,当我在 AD Explorer 中查看原始输出时,它会将整个属性值放在一行中,而不是在单独的行中显示每个 SMTP 和 X500 条目。

这一切都让我觉得这个值可能没有被正确界定。

当我将该属性与另一个环境进行比较时,另一个环境的值之间没有空格。

例如...我的:

X500:/o=foo/ou=foo Group (ABC123)/cn=Foo3/cn=foouser (blah)123; SIP:[email protected]; smtp:[email protected]; smtp:[email protected]; SMTP:[email protected]

另一个环境:

X500:/o=foo/ou=foo Group (ABC123)/cn=Foo3/cn=foouser (blah)123;SIP:[email protected];smtp:[email protected];smtp:[email protected];SMTP:[email protected]

所以我的问题是:

是否允许使用带空格的分号作为 Active Directory DirectoryString 属性值的分隔符?

active-directory
  • 2 2 个回答
  • 1162 Views

2 个回答

  • Voted
  1. natxo asenjo
    2017-12-12T13:01:09+08:002017-12-12T13:01:09+08:00

    我认为多值属性没有分隔符或分隔符。

    如果您使用 ldif 文件导入或导出数据,格式如下所示:

    dn: dc=example,dc=com
    objectClass: top
    objectClass: domain
    dc: example
    description: This is the first description value
    description: This is the second description value
    

    如果我使用标准 dsquery 工具查询我的帐户,我也会得到这种格式

    dsquery * "cn=my user name,ou=whatever,dc=sub,dc=domain,dc=tld" -scope base -attr * | findstr /i 
    proxyAddresses: smtp:[email protected]
    proxyAddresses: SMTP: [email protected]
    ...
    

    在 linux 主机上使用 ldapsearch 可以得到相同的 ldif 格式。所以我的猜测是应用程序没有正确解析过滤器的结果,它应该循环遍历返回的值列表。如果没有,那么在我看来,他们的代码中存在错误。

    根据msdn的 Proxy-Addresses 属性不是单值的,它的语法是string unicode。另外,msdn 有一个关于单值和多值属性msdn之间差异的小条目,但它没有说明任何关于分隔符或格式的内容(只是条目可能不是空的)。

    • 1
  2. Best Answer
    Clayton
    2017-12-13T07:51:05+08:002017-12-13T07:51:05+08:00

    从查询的角度来看,分隔符实际上只是一个用于呈现数据的装饰性显示选项。不同的工具将以不同的方式显示多个值。确保您在两种环境中使用相同版本的同一工具。

    中的attributes选项卡DSA.MSC使用带空格的分号,但打开该属性以使用 DSA 进行编辑,您会得到一个列表,其中每个属性都位于新行上。您可以查询和显示的其他一些方法:CSVDE将生成一个使用分号的文件。Get-Aduser将在一般查询中使用“,”,但在展开属性时使用换行符。

    csvde -r "(samaccountname=roadRunner)" -f this.csv -l proxyaddresses
    get-aduser -ldapfilter "(samaccountname=roadRunner)" -prop proxyaddresses
    (get-aduser -ldapfilter "(samaccountname=roadRunner)" -prop proxyaddresses).proxyaddresses
    

    当您运行相同的查询时是否找到了用户?get-aduser -ldapfilter "(&(objectClass=user)(proxyAddresses=SMTP:[email protected]))"

    • 1

相关问题

  • 如果以域用户身份远程登录,PC 速度极慢

  • 如何在 Windows 2003 的 ou 级别应用策略

  • 允许用户更改其 Active Directory 密码的 Web 界面

  • MOSS 2007 无法使用 ActiveDirectoryMembershipProvider 配置表单身份验证

  • 通过 VPN 更改 Active Directory 密码

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve