Exchange 2010 : Export-Csv EmailAddressPolicies by Priority

Exchange 2010 : Export-Csv EmailAddressPolicies by Priority

Use the following Exchange Shell command to export EmailAddressPolicy information, yes this is a large command in order to join all of the multi-string values together:

{code lang:xml showtitle:false lines:false hidden:true}Get-EmailAddressPoicy | select-object name,priority,RecipientFilter,RecipientFilterType,IncludedRecipients,EnabledPrimarySMTPAddressTemplate,Enabled,@{name=’ConditionalDepartment’;Expression={[STRING]::JOIN(";",($_.ConditionalDepartment))}},@{name=’ConditionalCompany’;Expression={[STRING]::JOIN(";",($_.ConditionalCompany))}},@{name=’ConditionalStateOrProvince’;Expression={[STRING]::JOIN(";",($_.ConditionalStateOrProvince))}},@{name=’ConditionalCustomAttribute1′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute1))}},@{name=’ConditionalCustomAttribute2′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute2))}},@{name=’ConditionalCustomAttribute3′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute3))}},@{name=’ConditionalCustomAttribute4′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute4))}},@{name=’ConditionalCustomAttribute5′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute5))}},@{name=’ConditionalCustomAttribute6′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute6))}},@{name=’ConditionalCustomAttribute7′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute7))}},@{name=’Conditio,alCustomAttribute8′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute8))}},@{name=’ConditionalCustomAttribute9′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute9))}},@{name=’ConditionalCustomAttribute10′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute10))}},@{name=’ConditionalCustomAttribute11′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute11))}},@{name=’ConditionalCustomAttribute12′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute12))}},@{name=’ConditionalCustomAttribute13′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute13))}},@{name=’ConditionalCustomAttribute14′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute14))}},@{name=’ConditionalCustomAttribute15′;Expression={[STRING]::JOIN(";",($_.ConditionalCustomAttribute15))}},@{name=’RecipientContainer’;Expression={[STRING]::JOIN(";",($_.RecipientContainer))}},@{name=’ObjectClass’;Expression={[STRING]::JOIN(";",($_.ObjectClass))}},@{name=’NonAuthoritativeDomains’;Expression={[STRING]::JOIN(";",($_.NonAuthoritativeDomains))} } | sort-object priority | export-csv C:\export.csv{/code}</p>'</p>’