3 user
=samir.benmendil@ultrahaptics.com
4 pass
=$(pass ultrahaptics/okta.com/samir.benmendil@ultrahaptics.com)
5 url
="https://outlook.office365.com/EWS/Exchange.asmx"
7 read -r -d '' data
<<EOF
8 <?xml version="1.0" encoding="utf-8"?>
9 <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
11 xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
12 xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
15 xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
16 xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
17 ReturnFullContactData="true">
18 <UnresolvedEntry>$1</UnresolvedEntry>
24 out
=$(curl -s -u "$user:$pass" -L "$url" -d "$data")
26 readarray
-t email
< <(echo $out | xpath
-q -e '//t:Mailbox/t:EmailAddress/text()')
27 readarray
-t name
< <(echo $out | xpath
-q -e '//t:Contact/t:DisplayName/text()')
31 if [[ "$count" -eq 0 ]]; then
37 for (( i
= 0; i
< $count; i
++ )); do
38 echo -e "${email[$i]}\t${name[$i]}\t"