Thanks jrv, however, doesn't that last method get the thumbnailphoto from the AD account? Sadly, we have the photo only stored in Office 365 and not sync'd back to AD.
Or should I be doing;
$user = Get-UserPhoto user@domain.com $user.thumbnailphoto | Set-Content "C:\Export\Photo$($user.Identity).jpg" -Encoding byte
Actually, looking at the methods for Get-UserPhoto, there is one called "PictureData" which is a Byte type. So I guess this might be better;
$user = Get-UserPhoto user@domain.com $user.PictureData |Set-Content "C:\Export\Photo$($user.Identity).jpg" -Encoding byte
Just tested this and, IT WORKS!
Thanks for putting me on the right track jrv.- Edited by Robin F Herbert Wednesday, November 12, 2014 12:49 PM update with thanks message
- Marked as answer by Robin F Herbert Friday, January 09, 2015 12:21 PM