##Connecting to O365
$credential = Get-Credential
Connect-MsolService -Credential $credential
##Add Exchange Online PowerShell
$exchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri “https://outlook.office365.com/powershell-liveid/?proxymethod=rps” -Credential $credential -Authentication “Basic” -AllowRedirection
Import-PSSession $exchangeSession -DisableNameChecking
##Get all licensed users
Get-MsolUser | Where-Object { $_.isLicensed -eq “True” } | Select DisplayName, MobilePhone, UserPrincipalName
##Set-UserPhoto
Set-UserPhoto “UserDisplayName” -PictureData ([System.IO.File]::ReadAllBytes(“C:\Users\Jimmy Hang\Pictures\minion.jpg”)) -Confirm:$false
https://support.microsoft.com/en-us/kb/3062745