跨域查询用户的全局地址列表(GAL)

发布于 2024-08-02 00:08:26 字数 968 浏览 3 评论 0 原文

我需要根据 Exchange Server 全局地址列表搜索名称中包含特定文本字符串的所有用户。 此操作将从 ASP.NET 应用程序执行。 请注意,GAL 是必需的(而不是 Active Directory),因为它包含跨域的用户。 这也是客户要求的。

我一直在研究 Exchange Web 服务和 Outlook Web Access 方法。 然而,我的组织中可能没有配置这两种选项,因此在要求基础设施配置它之前,我需要知道哪一个选项是正确的。

Exchange Web Services

我希望使用ResolveNames 方法。 它的文档指出:

首先搜索 Active Directory,然后搜索用户的联系人文件夹。

这似乎暗示此方法只会返回当前域中的用户。 它是否正确?

Outlook Web Access

我发现的另一个选项是 GALFind。 这看起来很完美,但是这篇文章 表示它不受支持。 此 Technet 文章中已确认该功能不再可用。

任何人都可以就这些或任何其他选项提供建议吗?

I need to search for all users containing a certain text string in their name against the Exchange Server Global Address List. This operation will be performed from an ASP.NET application. Note that the GAL is required (not Active Directory) as it contains users across domains. It's also what the customer requested.

I've been looking at Exchange Web Services and Outlook Web Access methods. However neither may be configured in my organisation so I need to know which option is the right one before asking infrastructure to configure it.

Exchange Web Services

I hoped to use the ResolveNames method in Exchange Web Services. The documentation for it states that:

Active Directory is searched first, and then the user's contact folder is searched.

It appears to imply that this method will only return users from the current domain. Is this correct?

Outlook Web Access

The other option I found was GALFind. This looks perfect but this article stated that it is unsupported. It is confirmed as no longer available in this Technet article.

Can anyone please give advice on these or any other options?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

忆梦 2024-08-09 00:08:26

通过从林根开始查询,可以跨域查询。 这是我最终使用的代码:

string filter = "(&(objectCategory=person)(objectClass=user)(name=*" + search + "*))";
var rootEntry = new DirectoryEntry("GC:");
foreach (DirectoryEntry entry in rootEntry.Children)
{
    DirectoryEntry forestEntry = entry;
    DirectorySearcher searcher = new DirectorySearcher
        {
            SearchRoot = forestEntry,
            Filter = filter,
            Sort =
                {
                    Direction = SortDirection.Ascending,
                    PropertyName = "cn"
                }
        };
    searcher.PropertiesToLoad.AddRange(ADProperties.Values.ToArray());
    SearchResultCollection results = searcher.FindAll();
    foreach (SearchResult result in results)
    {
        DirectoryEntry foundEntry = result.GetDirectoryEntry();

        // Do something
    }
}

It is possible to query across domains by starting the query from the forest root. Here is the code I ended up using:

string filter = "(&(objectCategory=person)(objectClass=user)(name=*" + search + "*))";
var rootEntry = new DirectoryEntry("GC:");
foreach (DirectoryEntry entry in rootEntry.Children)
{
    DirectoryEntry forestEntry = entry;
    DirectorySearcher searcher = new DirectorySearcher
        {
            SearchRoot = forestEntry,
            Filter = filter,
            Sort =
                {
                    Direction = SortDirection.Ascending,
                    PropertyName = "cn"
                }
        };
    searcher.PropertiesToLoad.AddRange(ADProperties.Values.ToArray());
    SearchResultCollection results = searcher.FindAll();
    foreach (SearchResult result in results)
    {
        DirectoryEntry foundEntry = result.GetDirectoryEntry();

        // Do something
    }
}
帅的被狗咬 2024-08-09 00:08:26

我不是 Exchange 专家,但您不能使用 协作数据对象 (CDO),尽管它可能不太迅速

I'm no Exchange expert but can't you do this using Collaboration Data Objects (CDO) although it might not be too swift.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文