Shawn
Shawn

Reputation: 3

Get SMTP address from a list of Names (Exchange 2013 powershell)

I'm trying to get SMTP address's for users who have OWAEnabled. I have what I think are two pieces that do what I want, but I can't figure out how to put them together. Ultimately it will output the SMTP address's to a CSV.

Get-CASMailbox -Filter{OWAEnabled -eq $true} | Select-Object Name This gets me a list of user "Names" who have OWA enabled.

Get-Mailbox -ResultSize Unlimited | Select-Object PrimarySmtpAddress This gets me Primary SMTP Address's

How do I put the two together? Sorry, i'm relatively new to PS.

Thanks for any help! :)

Upvotes: 0

Views: 1318

Answers (1)

mjolinor
mjolinor

Reputation: 68263

PrimarySMTPAddress is already a property of a CASMailbox object, so you just need to select it:

Get-CASMailbox -Filter{OWAEnabled -eq $true} | Select-Object Name,PrimarySMTPAddress

Most objects will have properties that aren't part of the default display properties, so they don't display by default.

Get-CasMailbox <identity> | format-list *

and you'll see all the available properties.

Upvotes: 0

Related Questions