I am trying to get the user Email
through a LookUpField. When I try to "Write-Host the Email", the screen is blank. There is no errors and nothing. What is wrong with my code? Any help is much appreciated.
ForEach ($ListItem in $ListItems){
$lookUpField = $ListItem["uQmsResponsible"] -as [Microsoft.SharePoint.Client.FieldLookupValue]
$user = $Web.EnsureUser($lookUpField.LookupValue.DisplayName);
Write-Host $user.Email -ForegroundColor Cyan
}
EDIT
Picture of the listSettings(columns) for the list "Roller" that the LookupField "uQmsResponsible" is referencing :
Picture of what Lookupfield returns: