Setting a profile picture on a guest account in an Entra ID tenant is not possible on the My account page due to restricted access to the directory as guest, there is however a way using PowerShell:
requirements:
- Profile picture in jpg (400x400px)
- PowerShell + AzureADpreview module
- The target TenantId
- Your LocalAccountId in the target tenant
How to get The Id’s
Open up https://myaccount.microsoft.com to acces you profile page, top right click on your profile picture & select switch organization
select the target organization you want to set the profile picture for
hit F12 & open Edge’s developer tools
In developer tools go to the application tab, under storage select session storage, then https://myaccount.microsoft.com
Now type feature in the search box to filter out the results, the 2 ID’s you need (localcAcountID & TenantId) are in the lower result screen, copy those
Installing the AzureADPreview module:
(this step can be skipped if already installed)
open up a PowerShell window
If you don’t have the AzureADPreview module yet, run
install-module AzureADPreview
accept the prompts
Connecting to the tenant:
run (replacing <tenantid> with the tenanID retrieved before)
connect-azuread -tenantid <tenantid>
authenticate with your guest account
Setting the profile picture:
run (replacing <localAccountId> with your ID & the path to your Picture)
Set-AzureADUserThumbnailPhoto -ObjectId <localAccountId> -FilePath 'C:\Temp\Photo400x400.jpg'
When the command returns no error it has worked.
to disconnect the powershell session run
disconnect-AzureAD
You can verify the picture by refreshing the my account page (give it a few minutes to be processed in the background)