查询Exchange 2007中的电子邮件别名列表

查询Exchange 2007中的电子邮件别名列表

我可以通过哪些方式查询我的 Exchange 2007 服务器中所使用的所有电子邮件别名?

答案1

这应该会给你一份清单

Get-Mailbox | fl UserPrincipalName, Emailaddresses, PrimarySMTPaddress

此命令将显示用户、smtp 地址和主地址。

答案2

抱歉,我没有早点回答,最后我使用 Google 进行了一些工作,并找到了以下内容,它为我提供了整个域的电子邮件地址、主电子邮件地址或别名的完整列表。谢谢!

http://exchangepedia.com/2005/09/how-to-export-all-email-addresses-from-a-domain.html

答案3

这是伙伴:

Get-Mailbox -resultSize unlimited | foreach{
 $emails= $_ | select -expand EmailAddresses | where {$_.PrefixString -eq 'smtp'} | sort IsPrimaryAddress -desc | foreach {$_.smtpAddress}
 [string]::join(",",$emails)
} > C:\alias.txt

答案4

这将输出一个可读格式的列表。我无法快速找出如何删除第一项上的“SmtpAddress”行,但您可以在记事本中轻松将其编辑掉。

Write-Host "SMTP Aliases";
foreach ($mailbox in Get-Mailbox | Sort-Object OrganizationalUnit, DisplayName) {
    Write-Host;
    Write-Host $mailbox.DisplayName;
    Write-Host $mailbox.OrganizationalUnit;
    Write-Host "========================";
    Get-Mailbox $mailbox -filter {EmailAddresses -notlike '*X400:*' -and EmailAddresses -notlike '*X500:*'} | Select-Object -expand EmailAddresses | Select-Object SmtpAddress
    Write-Host;
    Write-Host "---------------------------------------------";
}

示例输出

Administrator
domain.local/Users
========================

SmtpAddress
-----------
[email protected]
[email protected]

---------------------------------------------

Discovery Search Mailbox
domain.local/Users
========================
DiscoverySearchMailbox{D919BA05-46A6-415f-80AD-000000000000}@webdomain.com
DiscoverySearchMailbox{D919BA05-46A6-415f-80AD-000000000000}@domain.local

---------------------------------------------

Jane Doe
domain.local/Users
========================
[email protected]
[email protected]
[email protected]
[email protected]

---------------------------------------------

相关内容