SOLVED

Powershell command to extract UPN and primary SMTP from a set of Display name in csv file.

New Contributor

Hello All,

 

Please provide me PowerShell command to extract UPN and primary SMTP from a set of Display name in csv file. (office 365)

2 Replies
best response confirmed by Azhar_pasha (New Contributor)
Solution
This is a quick example on how to get the user information from a displayname

Get-MsolUser -SearchString 'UserDisplayName' | select UserPrincipalName,ProxyAddresses

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"