简体   繁体   English

如何从Powershell获取当前和存档邮箱的大小?

[英]How to get current and archive mailbox sizes from Powershell?

I am new to PowerShell so I am heavily relying on the Microsoft documentation while I am still new and learning. 我是PowerShell的新手,因此在我仍然是新手和学习者的同时,我在很大程度上依赖Microsoft文档。 I am trying to gather up the size of our Users current mailbox and their archive mailbox in order to make changes to our Company retention policy. 我正在尝试收集用户当前邮箱及其存档邮箱的大小,以便对我们的公司保留政策进行更改。 I know that I can get the archive mailbox size/percentage used from Exchange online, though I am wanting to get all of our users at one time instead of manually gather this information one user at a time. 我知道可以从Exchange在线获取存档邮箱的大小/百分比,尽管我希望一次获取所有用户,而不是一次手动收集一个用户的信息。

I have been following the microsoft documents, though I am not getting the results that I want. 我一直在关注Microsoft文档,尽管没有得到想要的结果。

I have ran a few commands and they return results as they should, though I am not familiar with how to properly get the information I need out of Office365. 尽管我不熟悉如何从Office365中正确获取所需的信息,但我已经运行了一些命令,它们会按预期返回结果。

Any assistance with this would be greatly appreciated and save my head from banging against my desk! 任何帮助,将不胜感激,并节省我的头撞在我的桌子上!

The microsoft documents that I was following: 我关注的Microsoft文档:

https://docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/get-mailboxfolderstatistics?view=exchange-ps https://docs.microsoft.com/zh-cn/powershell/module/exchange/mailboxes/get-mailboxfolderstatistics?view=exchange-ps

https://docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/get-mailbox?view=exchange-ps https://docs.microsoft.com/zh-cn/powershell/module/exchange/mailboxes/get-mailbox?view=exchange-ps

https://docs.microsoft.com/en-us/powershell/module/exchange/mailboxes/get-mailboxfolder?view=exchange-ps https://docs.microsoft.com/zh-cn/powershell/module/exchange/mailboxes/get-mailboxfolder?view=exchange-ps

The commands from the microsoft documents that I have ran and got results, just not the information I need. 我已经运行并获得结果的Microsoft文档中的命令,而不仅仅是我需要的信息。

Get-MailboxFolderStatistics -Identity Company\\FirstName.LastName Get-MailboxFolderStatistics -Identity Company \\ FirstName.LastName

Get-MailboxStatistics -Identity Company\\FirstName.LastName Get-MailboxStatistics-标识Company \\ FirstName.LastName

Get-Mailbox -Archive -ResultSize unlimited | Get-Mailbox-存档-ResultSize无限制| Export-CSV C:\\Archives.csv 导出CSV C:\\ Archives.csv

When I run the commands above, I do get results, but I am not getting the exact size of the user's mailbox or their archive mailbox. 当我运行上面的命令时,我确实得到了结果,但是我没有得到用户邮箱或其存档邮箱的确切大小。

For the size of a mailbox, get-mailboxstatistics will get you what you need. 对于邮箱的大小,get-mailboxstatistics将为您提供所需的信息。 Just make sure you are pulling the right properties: 只要确保您提取正确的属性即可:

get-MailboxStatistics username | select displayname,totalitemsize4
Get-MailboxFolderStatistics -Identity username | select name,foldersize
Get-MailboxFolderStatistics -Archive -Identity username | select name,foldersize

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM