Ran*_*Dom 4 powershell exchange active-directory ldap microsoft-office-365
我正在尝试使用 ADObject 上的 LDAPFilter 搜索 SMTP 地址
Get-AdObject -properties * -LDAPFilter "(proxyAddresses=alert.haveibeenpwned@test.edu)"
Run Code Online (Sandbox Code Playgroud)
我知道使用 GetADUser 和 Get-Mailbox 或什至使用带有-anr命令的-Filter 可以实现其中的某些功能。但是,为了保持一致性,我更喜欢将本机 LDAP 与 Get-AdObject 命令一起使用。
如何使用 Get-AdObject 搜索多值属性,例如 proxyAddresses?
Get-ADObject -Properties * -Filter {ProxyAddresses -eq "smtp:email@yourdomain.com"}
Get-ADObject -Properties * -LDAPFilter "(proxyAddresses=smtp:email@yourdomain.com)"
Run Code Online (Sandbox Code Playgroud)
过滤多值属性时,如果任何值与搜索字符串匹配,则满足过滤器要求。
但请注意语法smtp:email@yourdomain.com;该ProxyAddresses属性值总是有smtp:前缀(或一个不同的前缀为其他地址类型,例如SIP或X400)。
| 归档时间: |
|
| 查看次数: |
5760 次 |
| 最近记录: |