Thank you for your post and I apologize for the delayed response!
I understand that you're having issues retrieving the alternateEmailAddress data when it comes to downloading Azure AD users using your PowerShell script. To hopefully help point you in the right direction or resolve your issue, I'll share my findings below.
Findings:
When it comes to the $azuser.alternateEmailAddress parameter within your script, I reproduced your issue and was able to resolve it by using "Alt Email" = $azuser.OtherMails -join ";"
& {
foreach($azuser in Get-AzureADUser -All $true -Filter 'accountEnabled eq true') {
[pscustomobject]@{
"First Name" = $azuser.givenName
"Last Name" = $azuser.surname
"Full Name" = $azuser.displayName
"Work Email" = $azuser.UserPrincipalName
"User Type" = $azuser.usertype
"Job Title" = $azuser.JobTitle
"Department" = $azuser.department
"Office Location" = $azuser.physicalDeliveryOfficeName
"Street Address" = $azuser.streetAddress
"City" = $azuser.city
"State" = $azuser.state
"Postal Code" = $azuser.postalCode
"Telephone Number" = $azuser.telephoneNumber
"Mobile Phone" = $azuser.mobile
"Other Emails Test" = $azuser.OtherMails -join ";"
"Auth Email" = $azuser.authenticationEmail
"Auth Alt Phone Number" = $azuser.authenticationAlternativePhoneNumbeAzureADUserlistr
"Manager Name" = (Get-AzureADUserManager -ObjectId $azuser.ObjectId).displayName
}
}
} | Export-CSV -Path $path -NoTypeInformation
I hope this helps!
If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.
If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.