Link to home
Start Free TrialLog in
Avatar of rajanish tripathi
rajanish tripathi

asked on

exchange 2010 all users allocated mailbox size

Hi All,

i am unable to export exchange 2010 all users mailbox size allocation details. any one know good commond to export all users allocated mailbox quota detail
Avatar of Mahesh Sharma
Mahesh Sharma
Flag of United States of America image

Use below as a powershell script (.ps1), let me know if it helps
#############################################################################
#       Author: Mahesh Sharma
#       Date: 06/12/2012
#       Description: Extract the quota for all users
#############################################################################

# Add Exchange Shell...

If ((Get-PSSnapin | where {$_.Name -match "Exchange.Management"}) -eq $null)
{
      Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
}

#format Date

$date = get-date -format d
$date = $date.ToString().Replace(“/”, “-”)

$output = ".\" + "QuotaReport_" + $date + "_.csv"


#create a collection to hold results(dynamic array)

$Collection = @()
Get-Mailbox  -Database LAW-B -ResultSize Unlimited | foreach-object{
$st = get-mailboxstatistics $_.identity
$TotalSize = $st.TotalItemSize.Value.ToMB()
$user = get-user $_.identity


 
$mbxr = “” | select DisplayName, RecipientType,TotalItemSizeinMB, QuotaStatus,
UseDatabaseQuotaDefaults,IssueWarningQuota,ProhibitSendQuota,ProhibitSendReceiveQuota,
Itemcount, Email,ServerName,Company,Hidden, OrganizationalUnit,
RecipientTypeDetails,UserAccountControl
 
$mbxr.DisplayName = $_.DisplayName
$mbxr.RecipientType = $user.RecipientType
$mbxr.TotalItemSizeinMB = $TotalSize
$mbxr.QuotaStatus = $st.StorageLimitStatus
$mbxr.UseDatabaseQuotaDefaults = $_.UseDatabaseQuotaDefaults
$mbxr.IssueWarningQuota = $_.IssueWarningQuota.Value
$mbxr.ProhibitSendQuota = $_.ProhibitSendQuota.Value
$mbxr.ProhibitSendReceiveQuota = $_.ProhibitSendReceiveQuota.Value
$mbxr.Itemcount = $st.Itemcount
$mbxr.Email = $_.PrimarySmtpAddress
$mbxr.ServerName = $st.ServerName
$mbxr.Company = $user.Company
$mbxr.Hidden = $_.HiddenFromAddressListsEnabled
$mbxr.RecipientTypeDetails = $_.RecipientTypeDetails
$mbxr.OrganizationalUnit = $_.OrganizationalUnit
$mbxr.UserAccountControl = $_.UserAccountControl

$Collection += $mbxr
}
 
#export the collection to csv , change the path accordingly

$Collection | export-csv $output

#######################################################################################
Please modify Get-Mailbox  -Database LAW-B -ResultSize Unlimited to
Get-Mailbox  -ResultSize Unlimited to get result for all mailboxes
ASKER CERTIFIED SOLUTION
Avatar of Will Szymkowski
Will Szymkowski
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial