搜索UPN包含数字的Active Directory? [英] Search Active Directory where the UPN contains numbers?

查看:59
本文介绍了搜索UPN包含数字的Active Directory?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我有以下search.fiter,但如果我可以让搜索返回任何有数字组合的结果,那就太好了。我注意到AD中的一些帐户具有未正确配置的UPN,例如BB434343@domain.com。
我想找到所有那些有数字的人。在某些情况下,应该有一个数字,如batty.boy1@domain.com. 所以我想在sql中可以查询包含多个数字的值的内容。 所以
bob1会返回,但bob11会

Right now I have the following search.fiter but it would be nice if I could get my search to return any results where there is a combination of numbers. I have noticed a few accounts in AD that have UPNs that are not correctly configured e.g. BB434343@domain.com. I want to find all of those that have numbers in them. There will be cases where there should be a number such as batty.boy1@domain.com.  So I'm thinking a something like in sql where you can query the value that contains more than 1 number.  so bob1 would return but bob11 would

我很难过,希望能帮到你!

Im stumped on this, hoping for help!

search.Filter ="(&(objectClass = User)(userPrincipalName = *" + username +" *))" ;; ''

search.Filter = "(&(objectClass=User) (userPrincipalName=*" + username + "*))";''

干杯

推荐答案

否filter可以计算位数,或者即使任何字符都是数字。您需要检索所有userPrincipalName值,然后使用代码循环遍历结果以确定是否有多个字符是数字。

No filter can count the number of digits, or even if any characters are digits. You need to retrieve all userPrincipalName values, then loop through the results with code to determine if more than one character is a digit.

但是查看过滤器示例,可能会有助于检索所有不包含用户名的UPN。 "!"字符是"不"字符LDAP语法过滤器中的运算符。

But looking at your filter example, maybe it would help to retrieve all UPNs that do not include the username. The "!" character is the "Not" operator in an LDAP syntax filter.

search.Filter = "(&(objectClass=User) (!(userPrincipalName=*" + username + "*)))";''


这篇关于搜索UPN包含数字的Active Directory?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆