none
[Exchange Online] [EWS] [SOAP] [Win7] - Cannot read Permissions using EWS GetFolder RRS feed

  • Question

  • As suggested by Exchange Online Forum admin, I am reposting this to Exchange Dev forum.

    I am not sure is this a bug or stripped down feature in Exchange Online, but I know that it is severely affecting integration of our ERP system with Exchange Online:

    Folder element in GetFolder response does not include PermissionSet element. Samples request and invalid and correct responses are bellow.
    Thanks,
    Boris

    Request: 

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" 
    xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
       <soapenv:Header>
          <t:RequestServerVersion Version="Exchange2010_SP1"/>
       </soapenv:Header>
       <soapenv:Body>
            <m:GetFolder>
              <m:FolderShape>
                <t:BaseShape>AllProperties</t:BaseShape>
              </m:FolderShape>
              <m:FolderIds>
                <t:FolderId Id=".............................................." />
              </m:FolderIds>
            </m:GetFolder>   
    </soapenv:Body>
    </soapenv:Envelope>



    Incomplete response from Exchange Online:

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Header>
          <h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="670" MinorBuildNumber="17" Version="Exchange2013" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
       </s:Header>
       <s:Body>
          <m:GetFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
             <m:ResponseMessages>
                <m:GetFolderResponseMessage ResponseClass="Success">
                   <m:ResponseCode>NoError</m:ResponseCode>
                   <m:Folders>
                      <t:Folder>
                         <t:FolderId Id="................" ChangeKey="............"/>
                         <t:ParentFolderId Id="...................." ChangeKey=".............."/>
                         <t:DisplayName>AP_VCHERS</t:DisplayName>
                         <t:TotalCount>3</t:TotalCount>
                         <t:ChildFolderCount>0</t:ChildFolderCount>
                         <t:EffectiveRights>
                            <t:CreateAssociated>true</t:CreateAssociated>
                            <t:CreateContents>true</t:CreateContents>
                            <t:CreateHierarchy>true</t:CreateHierarchy>
                            <t:Delete>true</t:Delete>
                            <t:Modify>true</t:Modify>
                            <t:Read>true</t:Read>
                         </t:EffectiveRights>
                         <t:UnreadCount>0</t:UnreadCount>
                      </t:Folder>
                   </m:Folders>
    !!!!MISSING <t:PermissionSet>
    
                </m:GetFolderResponseMessage>
             </m:ResponseMessages>
          </m:GetFolderResponse>
       </s:Body>
    </s:Envelope>
    



    Good response from Exchange 2010:

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Header>
          <h:ServerVersionInfo MajorVersion="14" MinorVersion="1" MajorBuildNumber="438" MinorBuildNumber="0" Version="Exchange2010_SP1" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
       </s:Header>
       <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <m:GetFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
             <m:ResponseMessages>
                <m:GetFolderResponseMessage ResponseClass="Success">
                   <m:ResponseCode>NoError</m:ResponseCode>
                   <m:Folders>
                      <t:Folder>
                         <t:FolderId Id="..........................." ChangeKey="....."/>
                         <t:ParentFolderId Id="......................." ChangeKey="....."/>
                         <t:DisplayName>AP_VOUCHERS</t:DisplayName>
                         <t:TotalCount>36</t:TotalCount>
                         <t:ChildFolderCount>0</t:ChildFolderCount>
                         <t:EffectiveRights>
                            <t:CreateAssociated>true</t:CreateAssociated>
                            <t:CreateContents>true</t:CreateContents>
                            <t:CreateHierarchy>true</t:CreateHierarchy>
                            <t:Delete>true</t:Delete>
                            <t:Modify>true</t:Modify>
                            <t:Read>true</t:Read>
                         </t:EffectiveRights>
                         <t:PermissionSet>				!!!!GOOD RESPONSE
                            <t:Permissions>
                               <t:Permission>
                                  <t:UserId>
                                     <t:DistinguishedUser>Default</t:DistinguishedUser>
                                  </t:UserId>
                                  <t:CanCreateItems>false</t:CanCreateItems>
                                  <t:CanCreateSubFolders>false</t:CanCreateSubFolders>
                                  <t:IsFolderOwner>false</t:IsFolderOwner>
                                  <t:IsFolderVisible>false</t:IsFolderVisible>
                                  <t:IsFolderContact>false</t:IsFolderContact>
                                  <t:EditItems>None</t:EditItems>
                                  <t:DeleteItems>None</t:DeleteItems>
                                  <t:ReadItems>None</t:ReadItems>
                                  <t:PermissionLevel>None</t:PermissionLevel>
                               </t:Permission>
                               <t:Permission>
                                  <t:UserId>
                                     <t:DistinguishedUser>Anonymous</t:DistinguishedUser>
                                  </t:UserId>
                                  <t:CanCreateItems>false</t:CanCreateItems>
                                  <t:CanCreateSubFolders>false</t:CanCreateSubFolders>
                                  <t:IsFolderOwner>false</t:IsFolderOwner>
                                  <t:IsFolderVisible>false</t:IsFolderVisible>
                                  <t:IsFolderContact>false</t:IsFolderContact>
                                  <t:EditItems>None</t:EditItems>
                                  <t:DeleteItems>None</t:DeleteItems>
                                  <t:ReadItems>None</t:ReadItems>
                                  <t:PermissionLevel>None</t:PermissionLevel>
                               </t:Permission>
                               <t:Permission>
                                  <t:UserId>
                                     <t:SID>S-1-5-21-122642565-3798337455-3339469499-1452</t:SID>
                                     <t:PrimarySmtpAddress>User1@mydomain.com</t:PrimarySmtpAddress>
                                     <t:DisplayName>User1</t:DisplayName>
                                  </t:UserId>
                                  <t:CanCreateItems>true</t:CanCreateItems>
                                  <t:CanCreateSubFolders>false</t:CanCreateSubFolders>
                                  <t:IsFolderOwner>false</t:IsFolderOwner>
                                  <t:IsFolderVisible>true</t:IsFolderVisible>
                                  <t:IsFolderContact>false</t:IsFolderContact>
                                  <t:EditItems>Owned</t:EditItems>
                                  <t:DeleteItems>Owned</t:DeleteItems>
                                  <t:ReadItems>FullDetails</t:ReadItems>
                                  <t:PermissionLevel>Author</t:PermissionLevel>
                               </t:Permission>
                               <t:Permission>
                                  <t:UserId>
                                     <t:SID>S-1-5-21-122642565-3798337455-3339469499-1454</t:SID>
                                     <t:PrimarySmtpAddress>User3@mydomain.com</t:PrimarySmtpAddress>
                                     <t:DisplayName>User3</t:DisplayName>
                                  </t:UserId>
                                  <t:CanCreateItems>true</t:CanCreateItems>
                                  <t:CanCreateSubFolders>false</t:CanCreateSubFolders>
                                  <t:IsFolderOwner>false</t:IsFolderOwner>
                                  <t:IsFolderVisible>true</t:IsFolderVisible>
                                  <t:IsFolderContact>false</t:IsFolderContact>
                                  <t:EditItems>Owned</t:EditItems>
                                  <t:DeleteItems>Owned</t:DeleteItems>
                                  <t:ReadItems>FullDetails</t:ReadItems>
                                  <t:PermissionLevel>Author</t:PermissionLevel>
                               </t:Permission>
                               <t:Permission>
                                  <t:UserId>
                                     <t:SID>S-1-5-21-122642565-3798337455-3339469499-1453</t:SID>
                                     <t:PrimarySmtpAddress>User2@mydomain.com</t:PrimarySmtpAddress>
                                     <t:DisplayName>User2</t:DisplayName>
                                  </t:UserId>
                                  <t:CanCreateItems>true</t:CanCreateItems>
                                  <t:CanCreateSubFolders>false</t:CanCreateSubFolders>
                                  <t:IsFolderOwner>false</t:IsFolderOwner>
                                  <t:IsFolderVisible>true</t:IsFolderVisible>
                                  <t:IsFolderContact>false</t:IsFolderContact>
                                  <t:EditItems>Owned</t:EditItems>
                                  <t:DeleteItems>Owned</t:DeleteItems>
                                  <t:ReadItems>FullDetails</t:ReadItems>
                                  <t:PermissionLevel>Author</t:PermissionLevel>
                               </t:Permission>
                               <t:Permission>
                                  <t:UserId>
                                     <t:SID>S-1-5-21-122642565-3798337455-3339469499-500</t:SID>
                                     <t:PrimarySmtpAddress>Administrator@mydomain.com</t:PrimarySmtpAddress>
                                     <t:DisplayName>Administrator</t:DisplayName>
                                  </t:UserId>
                                  <t:CanCreateItems>true</t:CanCreateItems>
                                  <t:CanCreateSubFolders>true</t:CanCreateSubFolders>
                                  <t:IsFolderOwner>true</t:IsFolderOwner>
                                  <t:IsFolderVisible>true</t:IsFolderVisible>
                                  <t:IsFolderContact>true</t:IsFolderContact>
                                  <t:EditItems>All</t:EditItems>
                                  <t:DeleteItems>All</t:DeleteItems>
                                  <t:ReadItems>FullDetails</t:ReadItems>
                                  <t:PermissionLevel>Owner</t:PermissionLevel>
                               </t:Permission>
                            </t:Permissions>
                         </t:PermissionSet>
                         <t:UnreadCount>2</t:UnreadCount>
                      </t:Folder>
                   </m:Folders>
                </m:GetFolderResponseMessage>
             </m:ResponseMessages>
          </m:GetFolderResponse>
       </s:Body>
    </s:Envelope>
     
    



    Wednesday, May 1, 2013 2:01 PM

Answers

  • On Exchange 2013 there is a change where you need to tell the server to specifically return the permissions, else they won't be returned eg

          <m:GetFolder>
            <m:FolderShape>
              <t:BaseShape>AllProperties</t:BaseShape>
              <t:AdditionalProperties>
                <t:FieldURI FieldURI="folder:PermissionSet" />
              </t:AdditionalProperties>
            </m:FolderShape>
            <m:FolderIds>
              <t:DistinguishedFolderId Id="inbox" />
            </m:FolderIds>
          </m:GetFolder>

    Should work

    Cheers
    Glen

    Thursday, May 2, 2013 6:11 AM

All replies

  • On Exchange 2013 there is a change where you need to tell the server to specifically return the permissions, else they won't be returned eg

          <m:GetFolder>
            <m:FolderShape>
              <t:BaseShape>AllProperties</t:BaseShape>
              <t:AdditionalProperties>
                <t:FieldURI FieldURI="folder:PermissionSet" />
              </t:AdditionalProperties>
            </m:FolderShape>
            <m:FolderIds>
              <t:DistinguishedFolderId Id="inbox" />
            </m:FolderIds>
          </m:GetFolder>

    Should work

    Cheers
    Glen

    Thursday, May 2, 2013 6:11 AM
  • Hi Glen,

    Works perfect. You saved my day.

    Thanks a lot.

    Boris

    Thursday, May 2, 2013 5:51 PM