title: Using Powershell to get Office 365 SMTP: email addresses
body: <p>Found the exact script I need:</p>
  
  <p><a href="https://unlockpowershell.wordpress.com/2010/01/27/powershell-get-mailbox-display-smtp-addresses/" rel="nofollow noreferrer">https://unlockpowershell.wordpress.com/2010/01/27/powershell-get-mailbox-display-smtp-addresses/</a></p>
  
  <pre><code>Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=“EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}}
  </code></pre>
  
  <p>When I run this using Powershell5 against Office 365, "Email Addresses" is returned blank.</p>
  
  <p>Any ideas?</p>