Yvand / EntraCP

EntraCP (formerly AzureCP) is a claims provider that connects SharePoint to your Microsoft Entra ID tenant, in federated authentication
https://entracp.yvand.net/
Apache License 2.0
35 stars 8 forks source link

EntraCP - WorkEmail property remain blank when adding user through the People Picker. #225

Closed uday30980 closed 1 month ago

uday30980 commented 4 months ago

Hello Yvand,

WorkEmail property remain blank when adding user through the People Picker to the SharePoint site. This will trigger an issue that the email invitation will not send out. Here below is the image of the existing working Claims types configuration settings where PickerEntity Metadata remains blank since the EDIT link option not working due to the Javascript error that you have confirmed in earlier issue#220

image

Since you have confirmed that the "EDIT" link is not working due to some javascript error and it will not be available untill next release which will not happened now but may be in less than 3 months and so is it possible to update that highlighted PickerEntity data to Email using Powershell or some other way?

Yvand commented 4 months ago

hi @uday30980, yes it is possible, I will reply to you this week with a sample script to do it. Thank you for your patience

uday30980 commented 4 months ago

Thank you Yvand.I will wait for the sample script from you.Much appreciated!Thank youUday PatelSent from my iPhoneOn Jan 29, 2024, at 11:53 AM, Yvan Duhamel @.***> wrote: hi @uday30980, yes it is possible, I will reply to you this week with a sample script to do it. Thank you for your patience

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Yvand commented 4 months ago

@uday30980 you will fine the script below, but please make sure first that it does what you intend before executing it. Looking at your screenshot, it seems wrong to map the UPN claim type with the property 'Mail'

Add-Type -AssemblyName ('Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c')
Add-Type -AssemblyName "Yvand.EntraCP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=65dc6b5903b51636"
$config = [Yvand.EntraClaimsProvider.EntraCP]::GetConfiguration()
$settings = $config.Settings
$settings.ClaimTypes.GetByClaimType("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn").EntityDataKey
$settings.ClaimTypes.GetByClaimType("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn").EntityDataKey = [Microsoft.SharePoint.WebControls.PeopleEditorEntityDataKeys]::Email.ToString()
$config.ApplySettings($settings, $true)
uday30980 commented 4 months ago

@uday30980 you will fine the script below, but please make sure first that it does what you intend before executing it. Looking at your screenshot, it seems wrong to map the UPN claim type with the property 'Mail'

Add-Type -AssemblyName ('Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c')
Add-Type -AssemblyName "Yvand.EntraCP, Version=1.0.0.0, Culture=neutral, PublicKeyToken=65dc6b5903b51636"
$config = [Yvand.EntraClaimsProvider.EntraCP]::GetConfiguration()
$settings = $config.Settings
$settings.ClaimTypes.GetByClaimType("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn").EntityDataKey
$settings.ClaimTypes.GetByClaimType("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn").EntityDataKey = [Microsoft.SharePoint.WebControls.PeopleEditorEntityDataKeys]::Email.ToString()
$config.ApplySettings($settings, $true)

Thank you so much Yvand for your prompt reply. I am glad to inform you that I have run the above script that fixed the issue under ENTRACP.

Just a curosity to know if the same type of script available in AZURECP to update the PickerEntity Data to Email? We are currently using AZURECP People Picker and we are getting the same issue with Work Email property when user added to the SP Group and the Work Email remains blank.

Yvand commented 4 months ago

@uday30980 you can use the same logic to apply the change in AzureCP, although it needs little adaptation. And you should upgrade to EntraCP :)

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 5 days with no activity.