-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEX_Get-Mailbox_ActArcFolderSize.ps1
26 lines (22 loc) · 2.83 KB
/
EX_Get-Mailbox_ActArcFolderSize.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
###########################################################################
#
# NAME: Single User Mailbox and Folder Sizes.
#
# AUTHOR: Andrew Reeves
#
# COMMENT: Use this script to obtain the active, archive, and individual
# folder sizes for a specified mailbox.
#
# VERSION HISTORY:
# 1.0 2/28/2013 - Initial release
#
###########################################################################
$username = Read-Host -Prompt "Enter a username or email address (does NOT accept partials or wilcards) :"
# Get active/archive mailbox sizes and convert to MB.
Get-MailboxStatistics -Identity $username | Format-Table DisplayName,@{expression={$_.totalitemsize.value.ToMB()};Name="Mailbox Size (MB)"}
Get-MailboxStatistics -Identity $username -Archive | Format-Table DisplayName,@{expression={$_.totalitemsize.value.ToMB()};Name="Mailbox Size (MB)"}
Get-Mailbox -Identity $username | Format-List IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,ArchiveWarningQuota,ArchiveQuota
# Get mailbox folder list with item count and size (sorted by folder size).
Get-MailboxFolderStatistics -Identity $username -FolderScope all | Select-Object name,itemsinfolder,foldersize | Sort-Object foldersize -Descending
Write-Host "---- Archived Email Folders ----"
Get-MailboxFolderStatistics -Identity $username -Archive -FolderScope all | Select-Object name,itemsinfolder,foldersize | Sort-Object foldersize -Descending