2016-03-25 111 views
0

我想通过EWS从Exchange服务器获取所有用户。我已经意识到有可能使用FindPeople SOAP请求,如回答here将联系人添加到GlobalAddressList Exchange

中所述,因为它在回答中指出,这需要AddressListId。因此,我必须在PowerShell上创建Exchange上的GlobalAddressList。

我创建GlobalAddressList以下instructions

我不知道如何将用户添加到GlobalAddressList?

在列表中没有用户的事件我应该能够获得空列表?所以我尝试了。

这里是为请求:

<?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="someId" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" /> 
      </ParentFolderId> 
     </FindPeople> 
     </soap:Body> 
    </soap:Envelope> 

“someId” 以上的值是GlobalAddressList的GUID我创建。

以下是我收到的错误答案。

<?xml version=\"1.0\" encoding=\"utf-8\"?> 
<s:Envelope 
    xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\"> 
    <s:Header> 
     <Action s:mustUnderstand=\"1\" 
      xmlns=\"http://schemas.microsoft.com/ws/2005/05/addressing/none\">* 
     </Action> 
    </s:Header> 
    <s:Body> 
     <s:Fault> 
      <faultcode 
       xmlns:a=\"http://schemas.microsoft.com/exchange/services/2006/types\">a:ErrorInternalServerError 
      </faultcode> 
      <faultstring xml:lang=\"en-US\">An internal server error occurred. The operation failed.</faultstring> 
      <detail> 
       <e:ResponseCode 
        xmlns:e=\"http://schemas.microsoft.com/exchange/services/2006/errors\">ErrorInternalServerError 
       </e:ResponseCode> 
       <e:Message 
        xmlns:e=\"http://schemas.microsoft.com/exchange/services/2006/errors\">An internal server error occurred. The operation failed. 
       </e:Message> 
      </detail> 
     </s:Fault> 
    </s:Body> 
</s:Envelope> 

我不知道是什么问题,或者我在正确的轨道上。

我很感激任何有关如何让用户使用EWS的建议。假设在Office365面板上修改或PowerShell访问Exchange的解决方案也可以。

请指教。

+0

什么是这里的最终目标?是否有特定的需求通过EWS/SOAP获取用户?如果您想通过PowerShell管理Exchange上的用户,可以通过EMS cmdlet(通过import-pssession和您的交换中心fqdn获取)实现更简单的方法 –

+0

@ChrisKuperstein目标是使Exchange中的所有用户都能使用EWS。如果我不需要PowerShell更好。谢谢。 – eomeroff

+1

你为什么要创建一个新的全球通讯录?你不应该这样做。如果您登录到Outlook或OWA,您看到哪个GAL?您在OWA或Outlook中看到的地址列表是您可以在EWS中访问的唯一地址列表。 –

回答

1

您不应该创建新的Gal,您只需使用Get-GlobalAddressList cmdlet technet.microsoft.com/en-us/library/aa996579(v=exchg.160).aspx即可获取Id的正在使用的默认GAL。如果你没有获得你需要在cmdlet确保您使用该帐户在RBAC

格伦地址列表角色

相关问题