获得Active Directory用户的名字在Active Directory中不为空或为空 [英] get active directory users whose FirstName in active directory is not empty or NULL

查看:120
本文介绍了获得Active Directory用户的名字在Active Directory中不为空或为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 Searcher.Filter = "(&(objectCategory=person)(objectClass=user)(!givenName=""))"

使用上述活动目录搜索过滤器,以尝试并获得用户的名字在Active Directory中不为空或为空,但过滤器还是返回null项我'。

I'am using the above active directory search filter to try and get users whose FirstName in active directory is not empty or NULL but the filter still returns null entries.

我应该在过滤器更改为只retreive用户不是null或空一个名字

What should I change in the filter to only retreive users with a first name that is not NULL or Empty

推荐答案

您可以试试:

 Searcher.Filter = "(&(objectCategory=user)(objectClass=user)(givenName=*))"

要建立一个过滤器,你可以使用活动目录MMC注册查询:

To build a filter you can use registered query in Active-Directory MMC :

这篇关于获得Active Directory用户的名字在Active Directory中不为空或为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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