How to fix SharePoint user card ?

CHAMBENOIT Louis 40 Reputation points
2023-09-15T11:48:03.0166667+00:00

I have an issue with SharePoint.

I have a flow sending mails using the "Created" field of my Sharepoint list. It doesn't work for some users so I started to investigate the problem.

When I looked in my list, I saw that some users doesn't have a user card when I put my cursor on their name. It seems to be a problem with external users only. I thought it will come from the repertory linked to their account but no. I have two users coming from the same repertory and the flow works fine with one of them.

We compared the two users and it doesn't seem to be an obvious difference.

Can someone help me to figure out where this issue come from ?

Thank you.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,716 questions
{count} votes

Accepted answer
  1. Ling Zhou_MSFT 17,150 Reputation points Microsoft Vendor
    2023-09-19T08:12:26.6066667+00:00

    Hi @CHAMBENOIT Louis,

    In a typical SharePoint Online environment, The user profile synchronization process imports user profiles from On-Premises AD to Azure (through AD Sync Tool), and then from the Azure Active Directory (AAD), certain properties are mapped and synchronized with the SharePoint Online User Profiles.

    Please install PnP Module and AzureAD Module first.
    Here is the PowerShell to sync user email property value for all guest users:

    AdminSiteURL = "https://crescent-admin.sharepoint.com"
    $ADPropertyName = "proxyAddresses"
    $SPOPropertyName = "WorkEmail"
     
    #Get Credentials to connect to Azure AD and SharePoint Online Admin Center
    $Cred = Get-Credential
     
    Try {
        #Connect to AzureAD
        Connect-AzureAD -Credential $Cred | Out-Null
     
        #Get All Users of the Domain from AzureAD
        $AllUsers = Get-AzureADUser -All:$True -Filter "UserType eq 'Guest'"
        Write-host "Total Number of User Profiles Found:"$AllUsers.Count 
     
        #Connect to PnP Online
        Connect-PnPOnline -Url $AdminSiteURL -Credentials $Cred
     
        #Iterate through All Users
        $Counter = 1
        ForEach($User in $AllUsers)
        {
            Write-host "`nUpdating User Profile Property for: $($User.UserPrincipalName)" -f Yellow
     
            #Get the User Property value from Azure AD       
            $ADUserPropertyValue = $User | Select -ExpandProperty $ADPropertyName
     
            #Check if the AD Property is not Null
            If (!([string]::IsNullOrEmpty($ADUserPropertyValue)))
            {
                #Get existing User Profile Property from SharePoint
                $UserAccount = "i:0#.f|membership|$($User.UserPrincipalName)"
                $UserProfile = Get-PnPUserProfileProperty -Account $UserAccount
                $UserProfileProperty = $UserProfile.UserProfileProperties[$SPOPropertyName]
     
                #Check if the Existing SharePoint User Profile Property is Null
                If (([string]::IsNullOrEmpty($UserProfileProperty)))
                {
                    Set-PnPUserProfileProperty -Account $UserAccount -PropertyName $SPOPropertyName -Value $ADUserPropertyValue
                    Write-host "`tUpdated User Profile Property for: $($User.UserPrincipalName)" -f Green
                }
                Else
                {
                    Write-host "`t Existing Value of the Property in SharePoint is Not Null! Skipping..." -f Yellow
                }
            }
            else
            {
                Write-host "`t AD Value of the Property is Null! Skipping..." -f Yellow
            }
            $Counter++
            Write-Progress -Activity "Updating User Profile Data..." -Status "Updating User Profile $Counter of $($AllUsers.Count)" -PercentComplete (($Counter / $AllUsers.Count)  * 100)
        }
    }
    Catch {
        write-host -f Red "Error Updating User Profile Property!" $_.Exception.Message
    }
    

    Please note, this property update is only for SharePoint Online. It can’t be synced to Office 365 or Azure AD. User profile property created in the SharePoint Online admin center will not create or sync that property in Office 365!


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Ling Zhou_MSFT 17,150 Reputation points Microsoft Vendor
    2023-09-18T09:55:44.7733333+00:00

    Hi @CHAMBENOIT Louis,

    Thank you for your reply.

    The problem seems to be that you SharePoint is not synchronizing the information of external users.

    1.Let's first check the user's email address.

    Please go to SharePoint Admin center->more features->user profiles->Manage user profiles. Enter the username to see if there is a user profile for that user.

    Especially with email address information.

    image

    If there is no information about the user, then I suggest you delete the external user and re-add it.

    You can follow this thread to add an external user: how do we add external user in SharePoint.

    After re-adding you can check again to see if the user already has a user card. (I suggest you clear your browser cache first.)

    2.If after re-adding, there are still no user cards, you can ask your other colleagues to try adding external users and then see if the problem persists.

    Looking forward to receiving the results of your test. If there is any other assistance I can provide, please feel free to let me know.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

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.