Get all SMTP Address from Public Folders or Groups or anything in Exchange!

Here is a quick one, just change your mail domain where it says “MyDomain.com”

Public Folders Only:

Get-recipient -RecipientTypeDetails PublicFolder | select Name -ExpandProperty EmailAddresses | ? {$_.SMTPAddress -like “*MyDomain.com*”} | select Name, SMTPAddress

To pump to CSV:

Add this to the end: | Export-CSV C:\Filename.csv

Other  RecipientTypeDetails types? Just change the RecipientTypeDetails to one or more of the following (comma delimited):

  • MailUniversalDistributionGroup
  • MailUniversalSecurityGroup
  • DynamicDistributionGroup
  • MailNonUniversalGroup
  • MailUser
  • UserMailbox
  • PublicFolder
  • MailContact
  • DiscoveryMailbox
  • SharedMailbox
  • RoomMailbox
Advertisement

Tags: ,

About Eric

I am a IT Professional with over 10 years of real world experience. I current work as a IT generalist / IT Manager for a larger software company who writes products for the IT professional. Professionally I love what I do and it shows in my work. Personally I enjoy technology as a whole. Video games, Social Media, and Mobile technologies are all things I follow. I also love to play golf, go snowboarding, cook, love to eat, and read. As much as I don’t have a lot of free time, I always come across things that I believe could help others. I just wanted to be able to share what I find with others.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.