【发布时间】:2010-10-06 01:51:53
【问题描述】:
我注意到,当我打开 Exchange 管理控制台时,它会将具有“收件人类型详细信息”的邮箱显示为旧邮箱。
如何查询哪些是旧邮箱、用户邮箱或链接邮箱?
我试过了
get-mailbox -identity <displayname> | select deleteditemflags
但这似乎不起作用。
【问题讨论】:
标签: exchange-server exchange-management-shell
我注意到,当我打开 Exchange 管理控制台时,它会将具有“收件人类型详细信息”的邮箱显示为旧邮箱。
如何查询哪些是旧邮箱、用户邮箱或链接邮箱?
我试过了
get-mailbox -identity <displayname> | select deleteditemflags
但这似乎不起作用。
【问题讨论】:
标签: exchange-server exchange-management-shell
这将为您提供所有旧版或链接邮箱:
Get-Mailbox -resulteSize unlimited -RecipientTypeDetails LegacyMailbox,LinkedMailbox
仅限一位用户:
Get-Mailbox -Identity userName -RecipientTypeDetails LegacyMailbox,LinkedMailbox
编辑:
获取所有邮箱名称和类型
Get-Mailbox | Format-Table Name,RecipientTypeDetails
【讨论】:
您可以通过 Get-MailboxStatistics 获取已禁用和软删除的邮箱。有关详细信息,请参阅此链接: https://technet.microsoft.com/en-us/library/mt577269(v=exchg.160).aspx
要找到硬删除的邮箱,您必须寻找墓碑:
var path = "GC://{YourGlobalCatalogFQDN}";
var root = new DirectoryEntry(path, username, password);
var filter = "(objectClass=person)(isDeleted=TRUE)(msExchMailboxGuid=*)(cn=*)"; //tombstone mailboxes don't have 'objectCategory' property
var props = "objectClass sAMAccountName objectGUID msExchMailboxGuid cn whenChanged isDeleted".Split(' '); //tombstone mailboxes don't have 'mail' property
var ds = new DirectorySearcher(root, filter, props, SearchScope.Subtree);
ds.Tombstone = true;
using (var mailboxes = ds.FindAll())
{
foreach (SearchResult mailbox in mailboxes)
{ ... }
}
【讨论】: