Check Mailbox Size in GB using PowerShell in Exchange 2016
So, you're an Exchange 2016 administrator looking to check mailbox sizes? It's a common task, especially with newer Execute PowerShell scripts responding to increasing storage demands. But how do you get mailbox size in GB using PowerShell? Let's dive in.
Exchange 2016 uses a complex storage system, and understanding how to manage it is crucial for efficient resource utilization. You may have heard about the Mailbox _StorageQuotasHidden property, but what if you want to see the mailbox size in GB? Let's explore a couple of methods – using the Exchange Management Shell and a more straightforward PowerShell approach.
Using Exchange Management Shell
The Exchange Management Shell (EMS) is a robust tool for managing your Exchange server. Here's how you can use it to get mailbox sizes:
First, run the following command to display all mailbox sizes in your organization:
```powershell Get-Mailbox | Format-Table Name,TotalItemSize(GB) ```This command gets all mailboxes and formats the output to display the mailbox name and total mailbox size in GB. If you want to pipeline further for sorting, you can replace `Format-Table` with `| Sort-Object TotalItemSize`.
Getting Detailed Mailbox Size Information
To get more detailed information, like the size of each mailbox folder, use the Get-MailboxFolderStatistics cmdlet. Here's an example:
```powershell Get-MailboxFolderStatistics "user@domain.com" | Select-Object FolderAndSubfolders,FolderSize(GB) ```This command gives you the size of each folder (including subfolders) for a specified mailbox, again in GB. You can replace `"user@domain.com"` with `'$(_)` to get the sizes for all mailboxes, and pipe the output to sort by folder size.
Exporting Mailbox Size Data
Sometimes, you might want to export the mailbox size data for further analysis or backups. Use the following command to export mailbox sizes to a CSV file:
Using PowerShell ISE with Redemption in Exchange 2016
Another approach is using the Redemption PSTVw rescanning tool with PowerShell ISE. Redemption is a third-party tool designed to work with Exchange servers. Here's how to use it:
First, download and install the Redemption PSTVw tool from the official website. Then, in PowerShell ISE, run the following commands:
```powershell Add-Type -AssemblyName Redemption $rds = [Redemption.RDS.Cache]::Sesion("Domain", "Username", "Password") $rds.Logonsite() $rds.CommitChanges() $rds = $null Get-PersonalFolderStatistics -Identity "user@domain.com" -FolderFields "All" | Select-Object FolderPath,FolderSize(GB) ```The first few lines set up the Redemption session and authenticate with your Exchange server. The final command retrieves the mailbox size for the specified user, including folder and subfolder sizes in GB.
In Exchange 2016, managing mailbox sizes is crucial for maintaining optimal performance and preventing storage issues. Armed with these PowerShell methods, you can effectively monitor and manage mailbox sizes in your organization.
Remember, regular audits and proactive management are key to keeping your Exchange server healthy. Stay on top of mailbox sizes, and you'll minimize the risk of unexpected storage-related problems. Happy managing!