Import User Profile Picture from Exchange Online using EWS and PowerShell

One of our customer requested a solution to import user profile picture from Exchange Online. Not a big task but this article is to share the simple and clean method to carry out the task without MSOnline module. Yes, we use only PowerShell! At customer environment user uploads profile picture in intranet portal which saves the picture in file share, yeah I got the same question why can’t they get it from the file share? We can but not easy to do because of the profile image file naming convention, every user has an intranet portal profile ID so the files are saved as ID_DATETIMESTAMP. E.G “PROFILEID_YYYYMMDDHHMMSS”. There are many possibilities to do like query intranet portal DB to retrieve image file information and retrieve, use MSOnline module Get-UserPhoto etc.

Outclass is to use PowerShell and get it done on the fly. All we need is the EWS url for the profile picture residing in the Exchange Online and it’s shared below with sizes for reference and hew is the documentation for Get User Photos by using EWS in Exchange

1”UserEmail” &size=HR96x96 HR96x96
2”UserEmail” &size=HR240x240 HR240x240
3”UserEmail” &size=HR648x648 HR648x648


All set to spin up PowerShell ISE for scripting! Simply use Invoke-WebRequest cmdlet with OutFile parameter to save the profile image in disk like shown below

Yay, its easy to get the profile picture information at ease without using Get-UserPhoto cmdlet and no need of Set-Content with Encoding parameters (Saves more time) ! here is my picture – Output of the above snippet!


Check out the sample script below which use ADSI Searcher to retrieve user AD information and save the picture in disk as sAMAccountName_DisplayName.jpg 🙂


Events: Metalogix – SharePoint and Office 365 Road Map to the Cloud

On March 18, 2015 Metalogix organized and conducted a Road Show at Microsoft – Amsterdam. Title: SharePoint and Office 365 Road Map to the Cloud with the partnership of K2 , Wipro and Wortell.


  • How to drive adoption for Office 365
  • 5 Things you need to know before migrating to SharePoint 2013, Onedrive for Business and Office365
  • Large Office365 Migration and its best practices
  • Driving innovation with Office365 and Azure
  • Building Hybrid Business Apps in SharePoint
  • Designing a SharePoint Online Intranet


  • Amsterdam, Netherlands – Event Date March 18, 2015
  • Reading, UK – Event Date April 1, 2015
  • Cologne, Germany – April 17, 2015
  • Copenhagen, Denmark – Event Date May 21, 2015
  • Dublin, Ireland – Event Date June, 2015 [Date is not confirmed]

This event provided a great insight about Cloud Migrations. Most of the speakers delivered the challenges and best practices. K2 delivered a short demo about building interactive workflow in SharePoint platform which impressed many audience.

Team Metalogix spoke about 5 things you need to know before migrating to SharePoint 2013 – Which made audience to think a lot!

If you are planning to attend in any one of the mentioned location register and make use of it!



Do not forget to fill the feedback form! That’s a ticket for Winning Surface Pro!