1
votes

I am new to PowerShell so I am heavily relying on the Microsoft documentation while I am still new and learning. 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.

I have been following the microsoft documents, though I am not getting the results that I want.

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.

Any assistance with this would be greatly appreciated and save my head from banging against my desk!

The microsoft documents that I was following:

https://docs.microsoft.com/en-us/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/en-us/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.

Get-MailboxFolderStatistics -Identity Company\FirstName.LastName

Get-MailboxStatistics -Identity Company\FirstName.LastName

Get-Mailbox -Archive -ResultSize unlimited | Export-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.

1

1 Answers

2
votes

For the size of a mailbox, get-mailboxstatistics will get you what you need. 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