I am trying to update the user profile pictures with the Update-SPProfilePhotoStore -MySiteHostLocation https://sp.test.com/my/ -CreateThumbnailsForImportedPhotos $true and it is encountering this error. The my sites seem to have a document library containing
all the AD profile pictures that are named by GUID (like the one in the error). I am using an admin account to run this command (site collection admin, farm admin, etc.)
Update-SPProfilePhotoStore : Error processing the photo URL User
Photos/Profile Pictures/0c37852b-34d0-418e-91c6-2ac25af4be5b_93.jpg for user
test\testuser1: System.UnauthorizedAccessException:
<nativehr>0x80070005</nativehr><nativestack></nativestack>Access denied.
at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(Unauthori
zedAccessException ex)
at Microsoft.SharePoint.Library.SPRequest.PutFile(String bstrUrl, String
bstrWebRelativeUrl, Object punkFile, Int64 cbFile, Object punkSPFileMgr,
Object punkFFM, Int64 PutFileOpt, String bstrCreatedBy, String bstrModifiedBy,
Int32 iCreatedByID, Int32 iModifiedByID, Object varTimeCreated, Object
varTimeLastModified, Object varProperties, String bstrCheckinComment, String
bstrLockIdMatch, String bstEtagToMatch, Int32 lockType, String lockId, Int32
minutes, Int32 fRefreshLock, Int32 bValidateReqFields, Guid gNewDocId,
SPFileSaveParams sfsp, SPFileInfo& pFileProps, UInt32& pdwVirusCheckStatus,
String& pVirusCheckMessage, String& pEtagReturn, Byte& piLevel, Int32&
pbIgnoredReqProps)
at Microsoft.SharePoint.SPFileCollection.AddStreamOrBytesInternal(String
urlOfFile, Stream file, Int64 fileSizeToSave, SPFileStreamManager spmgr,
PutFileOpt fileOpt, String createdBy, String modifiedBy, Int32 createdByID,
Int32 modifiedByID, DateTime timeCreated, DateTime timeLastModified, Object
varProperties, String checkInComment, Stream formatMetadata, String
lockIdMatch, String etagToMatch, SPLockType lockType, String lockId, TimeSpan
lockTimeout, Boolean validateRequiredFields, SPVirusCheckStatus&
virusCheckStatus, String& virusCheckMessage, String& etagNew, Boolean&
ignoredRequiredProps)
at Microsoft.SharePoint.SPFileCollection.Add(String urlOfFile, Stream file,
Boolean overwrite, String checkInComment, Boolean checkRequiredFields)
at
Microsoft.Office.Server.UserProfiles.UserProfilePhotos.CreateThumbnail(Bitmap
original, Int32 idealWidth, Int32 idealHeight, SPFolder folder, String
fileName, Hashtable properties, Func`2 transform)
at
Microsoft.Office.Server.UserProfiles.UserProfilePhotos.CreateThumbnail(Bitmap
original, Int32 idealWidth, Int32 idealHeight, SPFolder folder, String
fileName, Func`2 transform)
at Microsoft.Office.Server.UserProfiles.PowerShell.SPCmdletUserProfilePhotoS
tore.InternalProcessRecord()
At line:1 char:1
+ Update-SPProfilePhotoStore -MySiteHostLocation https://sp.test.com/my/
-Cre ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
+ CategoryInfo : WriteError: (:) [Update-SPProfilePhotoStore], SP
Exception
+ FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.
SPCmdletUserProfilePhotoStore