OneLiner: Get all Mail-Aliases of all Users / Groups in one OU

As we had this request currently, we’ve created the following OneLiners, which i’d like to share with you:

Get all Mailbox-Aliases:

Get-Mailbox -OrganizationalUnit "[DN of OU]" | Select -Expand EmailAddresses Alias | Select SmtpAddress, Alias

Get all DistributionGroup-Aliases:

get-distributiongroup -OrganizationalUnit "[DN of OU]" | Select -Expand EmailAddresses Alias | Select SmtpAddress, Alias

Leave a Reply

Your email address will not be published. Required fields are marked *