I am trying to get user profile picture located in Microsoft Exchange Server [version 2013].
I can see the picture using below url [Example] :
Requirement:
To get all the company user's profile picture downloaded to a folder.
What I have done so far?
Written a Script using Php CURL
<?php
$user = 'user1@companydomain.com';
$password = 'XXXXXXX';
$fullurl="https://companydomain.com/owa/service.svc/s/GetPersonaPhoto?email=user1%40companydomain.com&size=HR96x96&sc=1464941029314";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
curl_setopt($ch, CURLOPT_USERPWD, "$user:$password");
curl_setopt($ch, CURLOPT_URL, $fullurl);
$returned = curl_exec($ch);
curl_close ($ch);
Output: A page containing: Object moved to here. as text and when I clicked on the link "here" it goes to login page of Microsoft Outlook.
Please help me to get desired out put and let me know what I am missing.
Thanks in advance