如何使用EWS从Exchange获取所有用户 [英] How to get all users from Exchange with EWS

查看:553
本文介绍了如何使用EWS从Exchange获取所有用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从所有带有EWS的xchange服务器中获取用户.我已经弄清楚了如何获得所有房间和所有约会.但是我特别需要所有用户,因此我可以从应用程序中删除用户.这有可能吗?我没有在网上找到任何示例.请提供有关如何实现此目标的建议.

I would like to get all users from xchange server with EWS. I have figured out how to get all rooms and all appointments. But I specifically need all users thus I can CRUD users from my application. Is this even possible? I did not find any example online. Please advise on how to achieve this.

Soap请求如何查找用户CRUD操作?

How would soap request look for user CRUD operations?

推荐答案

在Exchange 2013及更高版本上,可以将FindPeople操作与要访问的地址列表的GUID一起使用(例如,对于全局地址列表,请使用GAL的guid).

On Exchange 2013 and above you can use the FindPeople operation with the GUID of the address list you want to access (eg for the Global Address List you use the GAL's guid).

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Header>
        <RequestServerVersion Version="Exchange2013_SP1" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" />
      </soap:Header>
      <soap:Body>
        <FindPeople xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
          <IndexedPageItemView MaxEntriesReturned="100" Offset="0" BasePoint="Beginning" />
          <ParentFolderId>
            <AddressListId Id="5c90c254-2463-4256-bf52-60d82e6baa44" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" />
          </ParentFolderId>
        </FindPeople>
      </soap:Body>
    </soap:Envelope>

然后您可以使用偏移"将结果分页回去

You can then page the results back using the Offset

与此相关的一个问题是,您无法使用EWS获得所需的GUID,而需要使用Get-GlobalAddressList cmdlet

The one catch with this is you can't get the GUID you need using EWS you need to use the Get-GlobalAddressList cmdlet https://technet.microsoft.com/en-us/library/aa996579(v=exchg.160).aspx in Exchange Management Shell which will return the GUID you need for the request.

欢呼 格伦

这篇关于如何使用EWS从Exchange获取所有用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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