I was recently working on a solution for a customer where user photos needed to be synchronized from exchange online into sharepoint. The default sync seems a bit flakey and can take up to 72 hours for images to appear.
This led me to create 2 powershell scripts, one to grab the existing images in AD and create 2 columns in a csv – one with the userprincipal name and the other the path to the photo. Using this information and the photo extract, i am then able to upload the photo to Exchange using the Set-UserPhoto command. After user photos have been uploaded, the second script then grabs the images from the mailboxes and applies them to the sharepoint profile.
While this works fine and user images stay in sync everywhere within 365, the location of the user photos in https://company-my/User Photos/Profile Pictures takes up quite a bit of space once all images are uploaded. By default, the quote seems to be about 50mb which isn’t big enough for large enterprise environments who may have thousands of employees.
To get the size of the current quota, I used the following command:
Get-PnPTenantSite $siteUrl | fl
This gave me the output which contained the current maximum storage value
Then using the Set-PnPTenantSite command, i was able to increase this to the desired amount
Set-PnPTenantSite -Url $siteUrl -StorageMaximumLevel 10240
Looking at the value after running the command shows the maximum value has increased
This should allow for a whole lot of profile images!