从所有 Office 365 邮箱获取邮箱统计信息
Get-mailboxstatistics from all Office 365 Mailboxes
我需要我们所有云托管邮箱的 LastLogonTime。 Google 告诉我
Get-Mailbox | Get-MailboxStatistics
Get-Mailbox 当前 returns 2172 个邮箱,但是当将整个对象返回到 Get-MailboxStatistics 时,它在 59 个邮箱上给出错误:指定的邮箱 "Firstname Lastname" is'独一无二。
对于其中一些邮箱,我确实可以找到具有重复 DisplayName 的邮箱,但不是所有邮箱。
所以有些邮箱没有有效的 Get-MailboxStatistics 结果。但是当我从 ExchangeGuid 询问 Get-MailboxStatistics 时,记录被返回。即
Get-MailboxStatistics -Identity 7045326a-5c0f-4a84-aa0c-ceb$$$$c67fe
当我修改我的脚本以循环邮箱结果并查询每个邮箱的统计信息时,我得到(明显的)响应:该请求未在服务器上得到服务。你的请求太频繁了。请等待几分钟,然后重试。
所以..我的问题是..
如何通过管道将每个 Get-Mailbox 记录的 ExchangeGuid 传送到 Get-MailboxStatistics?
Get-Mailbox -ResultSize 5 | Select-Object ExchangeGuid | Get-MailboxStatistics
returns:
The input object cannot be bound to any parameters for the command either because the command does not take pipeline in put or the input and its properties do not match any of the parameters that take pipeline input.
+ CategoryInfo : InvalidArgument: (@{ExchangeGuid=...5-684390d4a758}:PSObject) [Get-MailboxStatistics], P arameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,Get-MailboxStatistics
+ PSComputerName : outlook.office365.com
您可以尝试使用唯一的 UPN(用户主体名称):
get-mailbox -ResultSize 5 |select -expand userprincipalname |Get-MailboxStatistics
我需要我们所有云托管邮箱的 LastLogonTime。 Google 告诉我
Get-Mailbox | Get-MailboxStatistics
Get-Mailbox 当前 returns 2172 个邮箱,但是当将整个对象返回到 Get-MailboxStatistics 时,它在 59 个邮箱上给出错误:指定的邮箱 "Firstname Lastname" is'独一无二。
对于其中一些邮箱,我确实可以找到具有重复 DisplayName 的邮箱,但不是所有邮箱。
所以有些邮箱没有有效的 Get-MailboxStatistics 结果。但是当我从 ExchangeGuid 询问 Get-MailboxStatistics 时,记录被返回。即
Get-MailboxStatistics -Identity 7045326a-5c0f-4a84-aa0c-ceb$$$$c67fe
当我修改我的脚本以循环邮箱结果并查询每个邮箱的统计信息时,我得到(明显的)响应:该请求未在服务器上得到服务。你的请求太频繁了。请等待几分钟,然后重试。
所以..我的问题是.. 如何通过管道将每个 Get-Mailbox 记录的 ExchangeGuid 传送到 Get-MailboxStatistics?
Get-Mailbox -ResultSize 5 | Select-Object ExchangeGuid | Get-MailboxStatistics
returns:
The input object cannot be bound to any parameters for the command either because the command does not take pipeline in put or the input and its properties do not match any of the parameters that take pipeline input.
+ CategoryInfo : InvalidArgument: (@{ExchangeGuid=...5-684390d4a758}:PSObject) [Get-MailboxStatistics], P arameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,Get-MailboxStatistics
+ PSComputerName : outlook.office365.com
您可以尝试使用唯一的 UPN(用户主体名称):
get-mailbox -ResultSize 5 |select -expand userprincipalname |Get-MailboxStatistics