当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 检查 Exchange Server 中的邮箱创建日期

作者:精品下载站 日期:2024-12-15 00:39:44 浏览:16 分类:玩电脑

检查 Exchange Server 中的邮箱创建日期


如何检查 Exchange Server 中邮箱的创建日期?有时我们会被要求检查邮箱何时创建。我们可以在 Active Directory 或 PowerShell 中检查创建日期。我们将从这两个方面进行探讨。在本文中,您将了解如何在 Active Directory 和 PowerShell 中检查邮箱创建日期。

检查邮箱创建日期 Active Directory

如何检查 Active Directory 中的邮箱创建日期?首先,启动Active Directory 用户和计算机 (ADUC)。单击菜单项查看。确保选中高级功能

[玩转系统] 检查 Exchange Server 中的邮箱创建日期

在 ADUC 中搜索用户。 右键单击用户,然后单击属性。如果需要,您可以双击该用户。

[玩转系统] 检查 Exchange Server 中的邮箱创建日期

单击属性编辑器选项卡。找到属性msExchWhenMailboxCreated

[玩转系统] 检查 Exchange Server 中的邮箱创建日期

查看邮箱创建日期。该值为 20200530191837。即日期 2020/05/30 和时间 19:18:37

ADUC 非常适合检查单个邮箱。如果我们想要获得邮箱创建日期的列表,最好使用 PowerShell。在下一部分中,我们将使用 PowerShell。

检查邮箱创建日期 PowerShell

我们可以使用 PowerShell 在 Exchange Server 中查找邮箱创建日期。借助PowerShell,我们可以进行搜索和过滤。它会给我们一个更好的结果。让我们看看它的实际效果。

组织内所有邮箱

首先,我们将获取组织中所有邮箱创建日期的列表。以管理员身份运行 Exchange 命令行管理程序并运行 cmdlet。

[PS] C:\>Get-Mailbox -ResultSize Unlimited | Select-Object Name,WhenMailboxCreated,PrimarySmtpAddress

Name                                                          WhenMailboxCreated    PrimarySmtpAddress
----                                                          ------------------    ------------------
Administrator                                                 4/6/2020 9:29:39 AM   [email protected]
Ali Tajran                                                    5/13/2020 1:10:39 AM  [email protected]
Amanda Morgan                                                 4/28/2020 2:49:29 PM  [email protected]
Benetiz Anees                                                 5/5/2020 9:04:29 PM   [email protected]
Boris Campbell                                                5/20/2020 5:20:06 PM  [email protected]
Christopher Payne                                             4/28/2020 2:49:29 PM  [email protected]
DiscoverySearchMailbox {D919BA05-46A6-415f-80AD-7E09334BB852} 5/11/2020 10:31:24 PM MsExchDiscoveryMailboxD919BA05-46A6-415f-80AD-7E09334BB852@exoip.com
Elizabeth Roberts                                             5/20/2020 5:31:07 PM  [email protected]
Jeff Allan                                                    5/30/2020 9:18:37 PM  [email protected]
Kylie Davidson                                                5/20/2020 5:31:37 PM  [email protected]

只检查一个邮箱

我们可以检查一个邮箱,而不是组织中的所有邮箱。我们将使用-Identity参数。添加您想要检查其邮箱创建日期的用户的显示名称电子邮件地址

[PS] C:\>Get-Mailbox -Identity "Jeff Allan" | Select-Object Name,WhenMailboxCreated,PrimarySmtpAddress

Name       WhenMailboxCreated   PrimarySmtpAddress
----       ------------------   ------------------
Jeff Allan 5/30/2020 9:18:37 PM [email protected]

再次,但这次是用户的电子邮件地址。

[PS] C:\>Get-Mailbox -Identity "[email protected]" | Select-Object Name,WhenMailboxCreated,PrimarySmtpAddress

Name       WhenMailboxCreated   PrimarySmtpAddress
----       ------------------   ------------------
Jeff Allan 5/30/2020 9:18:37 PM [email protected]

过滤邮箱创建日期

如果系统要求您检查最近几周的邮箱创建日期该怎么办?我们将检查过去 14 天的情况。

[PS] C:\>Get-Mailbox -ResultSize Unlimited | Where-Object {$_.WhenMailboxCreated -gt (Get-Date).AddDays(-14)} | ft Name,whenMailboxCreated,PrimarySmtpAddress -Autosize

Name              WhenMailboxCreated   PrimarySmtpAddress
----              ------------------   ------------------
Boris Campbell    5/20/2020 5:20:06 PM [email protected]
Elizabeth Roberts 5/20/2020 5:31:07 PM [email protected]
Jeff Allan        5/30/2020 9:18:37 PM [email protected]
Kylie Davidson    5/20/2020 5:31:37 PM [email protected]

我们想向表中添加更多项目。例如,我们想知道消息副本的发送状态以及它是否在地址列表中隐藏。

列出从 Get-Mailbox 返回的对象的所有属性。运行 cmdlet。

[PS] C:\>Get-Mailbox | Get-Member

运行上述 cmdlet 后,我们可以看到属性名称。我们需要的属性名称是 MessageCopyForSentAsEnabledHiddenFromAddressListsEnabled。将其添加到 cmdlet 并运行它。

[PS] C:\>Get-Mailbox -ResultSize Unlimited | Where-Object {$_.WhenMailboxCreated -gt (Get-Date).AddDays(-14)} | ft Name,whenMailboxCreated,PrimarySmtpAddress,MessageCopyForSentAsEnabled,HiddenFromAddressListsEnabled -Autosize

Name              WhenMailboxCreated   PrimarySmtpAddress          MessageCopyForSentAsEnabled HiddenFromAddressListsEnabled
----              ------------------   ------------------          --------------------------- -----------------------------
Boris Campbell    5/20/2020 5:20:06 PM [email protected]                          False                         False
Elizabeth Roberts 5/20/2020 5:31:07 PM [email protected]                       False                         False
Jeff Allan        5/30/2020 9:18:37 PM [email protected]                              False                         False
Kylie Davidson    5/20/2020 5:31:37 PM [email protected]                          False                         False

将邮箱创建日期导出到文件

现在我们有了信息,让我们将输出导出到文本文件。

[PS] C:\>Get-Mailbox -ResultSize Unlimited | Where-Object {$_.WhenMailboxCreated -gt (Get-Date).AddDays(-14)} | ft Name,whenMailboxCreated,PrimarySmtpAddress,MessageCopyForSentAsEnabled,HiddenFromAddressListsEnabled -Autosize | Out-File "C:\mailbox_created_14_days.txt" -Encoding UTF8

转到 C: 驱动器并打开文本文件。

[玩转系统] 检查 Exchange Server 中的邮箱创建日期

我们可以将输出导出为 CSV。

[PS] C:\>Get-Mailbox -ResultSize Unlimited | Where-Object {$_.WhenMailboxCreated -gt (Get-Date).AddDays(-14)} | Select-Object Name,whenMailboxCreated,PrimarySmtpAddress,MessageCopyForSentAsEnabled,HiddenFromAddressListsEnabled | Export-Csv "C:\mailbox_created_14_days.csv" -NoTypeInformation -Encoding UTF8

转到 C: 驱动器并使用您喜欢的查看器打开 CSV。我们将使用 Microsoft Excel。

[玩转系统] 检查 Exchange Server 中的邮箱创建日期

看起来很棒。我们可以在 Microsoft Excel 中按姓名或邮箱创建日期进行排序。

现在我们解释了如何在 PowerShell 和 Active Directory 中检查邮箱创建,它对您有帮助吗?

结论

在本文中,您了解了如何在 Exchange Server 中检查邮箱创建日期。首先,我们检查了 Active Directory 中的邮箱创建日期。之后,我们使用 PowerShell 检查了邮箱创建日期。截至最后,我们将结果导出到文本和 CSV 文件。与 Active Directory 相比,PowerShell 有更多选项。

如果您喜欢本文,您可能还想阅读在 Windows Server 中删除 Let’s Encrypt 证书。您还可以在 Twitter 和 LinkedIn 上找到我们,了解最新文章。

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯