none
Issue with exporting email address policies to CSV in EMS

    Question

  • I am attempting to use the following to export some of the properties of email address policies to CSV using EMS;

    Get-EmailAddressPolicy | Select Name,LdapRecipientFilter,RecipientFilterApplied,IncludedRecipients,EnabledEmailAddressTemplate,EnabledPrimarySMTPAddressTemplate | Export-Csv C:\Temp\temp.csv

    When I do that, it creates a CSV with the appropriate fields, but the EnabledEmailAddressTemplate property (that returns the appropriate information in EMS) returns Microsoft.Exchange.Data.ProxyAddressTemplateCollection for a value, not the expected SMTP addressing.


    Tuesday, April 26, 2016 8:47 PM

Answers

  • Hi,

    Please try below command to export:

    Get-EmailAddressPolicy | Select Name,LdapRecipientFilter,RecipientFilterApplied,IncludedRecipients,EnabledPrimarySMTPAddressTemplate,@{Name='EnabledEmailAddressTemplates`;Expression={[string]::join(";", ($_.EnabledEmailAddressTemplates))}} | Export-Csv C:\Temp\temp.csv

    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Allen Wang
    TechNet Community Support

    Thursday, April 28, 2016 8:35 AM
    Moderator

All replies

  • First, the property is EnabledEmailAddressTemplates.

    That's because it's a collection, i.e., a mutivalued attribute, and not a single value or string.  You'll have to convert that property into something exportable.


    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
    Celebrating 20 years of providing Exchange peer support!


    Tuesday, April 26, 2016 10:26 PM
    Moderator
  • Hi,

    Please try below command to export:

    Get-EmailAddressPolicy | Select Name,LdapRecipientFilter,RecipientFilterApplied,IncludedRecipients,EnabledPrimarySMTPAddressTemplate,@{Name='EnabledEmailAddressTemplates`;Expression={[string]::join(";", ($_.EnabledEmailAddressTemplates))}} | Export-Csv C:\Temp\temp.csv

    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Allen Wang
    TechNet Community Support

    Thursday, April 28, 2016 8:35 AM
    Moderator