C# 如何检查Active Directory中是否存在地址列表?

C# 如何检查Active Directory中是否存在地址列表?,c#,active-directory,C#,Active Directory,在从Active Directory中获取所有项目之前,我需要检查所有全局地址列表、所有地址列表和所有系统地址列表是否存在 你能给我一些建议或文章,我可以解决我的问题吗 谢谢。地址列表是Exchange功能的一部分,而不是Active Directory,我认为人们对此感到困惑 无论如何,地址列表数据存储在Active Directory配置上下文中的以下位置: CN=地址列表容器,CN=,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC

在从Active Directory中获取所有项目之前,我需要检查所有全局地址列表、所有地址列表和所有系统地址列表是否存在

你能给我一些建议或文章,我可以解决我的问题吗


谢谢。

地址列表是Exchange功能的一部分,而不是Active Directory,我认为人们对此感到困惑

无论如何,地址列表数据存储在Active Directory配置上下文中的以下位置:

CN=地址列表容器,CN=,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=

您可以使用ADSIEdit查看信息

在C#中,您可以使用LDAP查询来检索现有地址列表的信息

编辑:类似这样的内容:

DirectoryEntry rootDSE = new DirectoryEntry("LDAP://RootDSE");
DirectoryEntry configContainer = new DirectoryEntry("LDAP://" + rootDSE.Properties["configurationNamingContext"].Value);
DirectorySearcher configSearcher = new DirectorySearcher(configContainer);
configSearcher.Filter = "(&(objectClass=addressBookContainer))";
configSearcher.PropertiesToLoad.Add("displayName");
configSearcher.PageSize = 10000;
configSearcher.SearchScope = SearchScope.Subtree;
SearchResultCollection results = configSearcher.FindAll();

你在说什么?那个地址是什么&地址列表。你的问题毫无结果。请详细说明。对不起,帕拉克,你听说过Active Directory吗@@它的广告,我知道了你的问题是关于,但我关心的不是广告。谢谢你的评论。但是,我需要检查它是否存在于AD中。@PhucNguyen您需要更好地解释自己,因为这会检查地址列表是否存在于AD中。