EWS Managed api中的方法是否与PowerShell中的Get-CalendarProcessing方法类似?

时间:2015-11-26 16:25:59

标签: powershell ews-managed-api

使用PowerShell我可以通过执行命令Get-CalendarProcessing -Identity "ROOM_NAME" | Format-List轻松地了解房间中的“BookInPolicy”状态 但问题是通过使用EWS管理API来实现类似的东西。 我花了很多时间在互联网上探讨这个问题,不幸的是我一无所获。这真的有意义吗?我希望你能给我一些有用的建议或解决方案。

1 个答案:

答案 0 :(得分:1)

通过使用GetUserConfiguration EWS请求,您可以获取一些BookInPolicy信息。

E.g。发送以下会议室日历请求

<?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:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2010_SP2"/>
  </soap:Header>
  <soap:Body>
    <m:GetUserConfiguration>
      <m:UserConfigurationName Name="Calendar">
        <t:DistinguishedFolderId Id="calendar">
          <t:Mailbox>
            <t:EmailAddress>room@company.com</t:EmailAddress>
          </t:Mailbox>
        </t:DistinguishedFolderId>
      </m:UserConfigurationName>
      <m:UserConfigurationProperties>All</m:UserConfigurationProperties>
    </m:GetUserConfiguration>
  </soap:Body>
</soap:Envelope>

您将获得包含(以及其他)以下两个字段的信息字典

<t:DictionaryEntry>
  <t:DictionaryKey>
    <t:Type>String</t:Type>
    <t:Value>AllBookInPolicy</t:Value>
  </t:DictionaryKey>
  <t:DictionaryValue>
    <t:Type>Boolean</t:Type>
    <t:Value>false</t:Value>
  </t:DictionaryValue>
</t:DictionaryEntry>
<t:DictionaryEntry>
  <t:DictionaryKey>
    <t:Type>String</t:Type>
    <t:Value>BookInPolicy</t:Value>
  </t:DictionaryKey>
  <t:DictionaryValue>
    <t:Type>StringArray</t:Type>
    <t:Value>75480a35-de48-46ad-8378-7c66137de736</t:Value>
    <t:Value>498e21e9-1d88-4254-bea0-8d976c3e451d</t:Value>
    <t:Value>08ffb1dd-64b8-438f-a924-ac3782975abf</t:Value>
  </t:DictionaryValue>
</t:DictionaryEntry>

缺点是我不知道如何查询BookInPolicy收到的ID。

您可以使用GetFolder请求获取一些权限信息

<?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:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2010_SP2"/>
  </soap:Header>
  <soap:Body>
    <m:GetFolder>
      <m:FolderShape>
        <t:BaseShape>AllProperties</t:BaseShape>
      </m:FolderShape>
      <m:FolderIds>
        <t:DistinguishedFolderId Id="calendar">
          <t:Mailbox>
            <t:EmailAddress>room@company.com</t:EmailAddress>
          </t:Mailbox>
        </t:DistinguishedFolderId>
      </m:FolderIds>
    </m:GetFolder>
  </soap:Body>
</soap:Envelope>

并查看返回的权限集,但我没有找到任何方法将权限信息连接到BookInPolicy ID。 (以下样本许可)

<t:CalendarPermission>
  <t:UserId>
    <t:SID>S-1-5-21-799214634-780288877-1039276024-11759</t:SID>
    <t:PrimarySmtpAddress>group@company.com</t:PrimarySmtpAddress>
    <t:DisplayName>group</t:DisplayName>
  </t:UserId>
  <t:CanCreateItems>false</t:CanCreateItems>
  <t:CanCreateSubFolders>false</t:CanCreateSubFolders>
  <t:IsFolderOwner>false</t:IsFolderOwner>
  <t:IsFolderVisible>true</t:IsFolderVisible>
  <t:IsFolderContact>false</t:IsFolderContact>
  <t:EditItems>None</t:EditItems>
  <t:DeleteItems>None</t:DeleteItems>
  <t:ReadItems>FullDetails</t:ReadItems>
  <t:CalendarPermissionLevel>Reviewer</t:CalendarPermissionLevel>
</t:CalendarPermission>