Forum Discussion
Azhar_pasha
Mar 01, 2021Copper Contributor
Powershell command to extract UPN and primary SMTP from a set of Display name in csv file.
Hello All,
Please provide me PowerShell command to extract UPN and primary SMTP from a set of Display name in csv file. (office 365)
- This is a quick example on how to get the user information from a displayname
Get-MsolUser -SearchString 'UserDisplayName' | select UserPrincipalName,ProxyAddresses
- farismalaebSteel ContributorThis is a quick example on how to get the user information from a displayname
Get-MsolUser -SearchString 'UserDisplayName' | select UserPrincipalName,ProxyAddresses- Azhar_pashaCopper Contributor
Hi farismalaeb ,
Thanks for the below command, However, I was trying on exchange online shell. Hit with an idea to use like this.
Import-Csv "csv path" | foreach{Get-Mailbox -Identity $_.displaynames} | select *UserPrincipalName*, *PrimarySmtpAddress* | Export-Csv "export path"