Failed to upload user profile photo for undefined Azure for student Active Directory Microsoft Entra Id

dorra bouaziz 0 Reputation points
2024-07-29T15:42:48.8233333+00:00

Hi can you help me out. I can't upload user profile photo in Microsoft Entra Id to get it later in my application. I have tried both with user interface and with command line

User's image User's image

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,126 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. akinbade abiola 18,305 Reputation points
    2024-07-29T20:44:13.26+00:00

    Hello Dorra,

    Thanks for your question.

    The error usually occurs, if you are connecting Azure AD with Insufficient privileges (user has no admin privileges) or connecting with the wrong Tenant-ID

    Try to connect again using:

    Connect-AzureAD -TenantId "<Your-Tenant-ID>"
    

    If you have multiple tenants or are unsure of the permissions, reauthenticate with an account that has admin privileges in the correct tenant. e.g Global Admin.

    See: https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-list-portal

    Get-AzureADDirectoryRole -ObjectId "<user>"
    

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola


  2. Navya 12,325 Reputation points Microsoft Vendor
    2024-07-31T04:25:13.0033333+00:00

    Hi @dorra bouaziz

    Thank you for posting this in Microsoft Q&A.

    I understand that you are encountering an error stating "Failed to upload user profile photo for undefined" while trying to upload a user profile in Entra.

    Based on the provided screenshots, it appears that the user was not found in the tenant to which you are connected. Please ensure that the user exists in the tenant you are attempting to log into. Make sure that the user is present in the tenant to which you are connected.

    Run below PowerShell commands:

    Connect-AzureAD -TenantId  <TenantId>
    Get-AzureADUser -ObjectId <objectId>
    Set-AzureADUserThumbNailPhoto -ObjectId <user objectid/UPN> -FilePath c:\desktop\MyPhoto.jpg
    
    

    If you are still experiencing any issues, please send us an email at azcommunity[at]microsoft[dot]com with the subject "ATTN: Navya" and include the following details in the email body: a link to this thread/post. We can then connect offline to discuss further.

    Hope this helps. Do let us know if you any further queries.

    Thanks,

    Navya.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.