none
Export Office 365 GAL using EWS API (FindPeople) using non-admin user RRS feed

  • Question

  • Hi,

    I have a non-admin (simple) office 365 mailbox, and need to export my company GAL using EWS API + PowerShell. 

    I found this very good script from Glen Scales Export GAL using EWS and it uses GUID of GAL retrieved using Get-GlobalAddressList PS command, to be used in 

    <AddressListId Id="$GALGUID" > 

    in soap request.

    My question is, is there any way I Can get GUID of Default Global Address List in anyway (may be using Outlook), as I dont have admin credentials, so cannot run Get-GlobalAddressList command.

    If I use FindPeople EWS call to serach Directory, then I have to use 'QueryString' (due to api restriction), due to that i cannot browse entire GAL.

    <m:ParentFolderId>
            <t:DistinguishedFolderId Id="directory"/>
          </m:ParentFolderId>

    <m:QueryString>userToSearch</m:QueryString> 

    Regards,


    Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com

    Monday, August 7, 2017 9:03 PM

Answers

  • The easiest way is you can get it using OWA if you just switch the developer tools on in your favorite browser hit the people and you should see it make a request list https://outlook.office365.com/owa/service.svc?action=GetPeopleFilters&EP=1&ID=-62&AC=1

    if you have a look at that response it should include the default Global Address list and the Guid your after eg

    \/0Y6jBNnUCxQousINAAAAIBDgAAAA==","ChangeKey":"AQAAAA=="},"SortGroupPriority":10,"TotalCount":0},{"DisplayName":"Default Global Address List","FolderId":{"__type":"AddressListId:#Exchange","Id":"5c90c254-2463-4256-bf52-60d82e6baa44"},"IsReadOnly":true,"ParentFolderId":null,"SortGroupPriority":1000,"TotalCount":0},{"DisplayName":"All Rooms","FolderId":{"__type":"AddressListId:#Exchange","Id":"bee04d44-5394-491c-a96a-

    the value in Id is what you need

    Cheers
    Glen

    • Marked as answer by Laeeq Qazi Tuesday, August 8, 2017 7:37 PM
    Tuesday, August 8, 2017 4:48 AM

All replies

  • The easiest way is you can get it using OWA if you just switch the developer tools on in your favorite browser hit the people and you should see it make a request list https://outlook.office365.com/owa/service.svc?action=GetPeopleFilters&EP=1&ID=-62&AC=1

    if you have a look at that response it should include the default Global Address list and the Guid your after eg

    \/0Y6jBNnUCxQousINAAAAIBDgAAAA==","ChangeKey":"AQAAAA=="},"SortGroupPriority":10,"TotalCount":0},{"DisplayName":"Default Global Address List","FolderId":{"__type":"AddressListId:#Exchange","Id":"5c90c254-2463-4256-bf52-60d82e6baa44"},"IsReadOnly":true,"ParentFolderId":null,"SortGroupPriority":1000,"TotalCount":0},{"DisplayName":"All Rooms","FolderId":{"__type":"AddressListId:#Exchange","Id":"bee04d44-5394-491c-a96a-

    the value in Id is what you need

    Cheers
    Glen

    • Marked as answer by Laeeq Qazi Tuesday, August 8, 2017 7:37 PM
    Tuesday, August 8, 2017 4:48 AM
  • Thanks a lot Glen. You saved my day. Using owa, we can see GUIDs of all available Address Lists.

    I got the GAL GUID using owa, in chrome->Devleoper tools

    GAL GUID OWA

    Regards,


    Laeeq Qazi|Team Lead(Exchange + Sharepoint + BES + DynamicsCRM) www.HostingController.com

    Tuesday, August 8, 2017 7:43 PM