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
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
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.Managem ent.PowerS hell.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.To MB()
$user = get-user $_.identity
$mbxr = “” | select DisplayName, RecipientType,TotalItemSiz einMB, QuotaStatus,
UseDatabaseQuotaDefaults,I ssueWarnin gQuota,Pro hibitSendQ uota,Prohi bitSendRec eiveQuota,
Itemcount, Email,ServerName,Company,H idden, OrganizationalUnit,
RecipientTypeDetails,UserA ccountCont rol
$mbxr.DisplayName = $_.DisplayName
$mbxr.RecipientType = $user.RecipientType
$mbxr.TotalItemSizeinMB = $TotalSize
$mbxr.QuotaStatus = $st.StorageLimitStatus
$mbxr.UseDatabaseQuotaDefa ults = $_.UseDatabaseQuotaDefault s
$mbxr.IssueWarningQuota = $_.IssueWarningQuota.Value
$mbxr.ProhibitSendQuota = $_.ProhibitSendQuota.Value
$mbxr.ProhibitSendReceiveQ uota = $_.ProhibitSendReceiveQuot a.Value
$mbxr.Itemcount = $st.Itemcount
$mbxr.Email = $_.PrimarySmtpAddress
$mbxr.ServerName = $st.ServerName
$mbxr.Company = $user.Company
$mbxr.Hidden = $_.HiddenFromAddressListsE nabled
$mbxr.RecipientTypeDetails = $_.RecipientTypeDetails
$mbxr.OrganizationalUnit = $_.OrganizationalUnit
$mbxr.UserAccountControl = $_.UserAccountControl
$Collection += $mbxr
}
#export the collection to csv , change the path accordingly
$Collection | export-csv $output
########################## ########## ########## ########## ########## ########## ########## #
# 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.Managem
}
#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.To
$user = get-user $_.identity
$mbxr = “” | select DisplayName, RecipientType,TotalItemSiz
UseDatabaseQuotaDefaults,I
Itemcount, Email,ServerName,Company,H
RecipientTypeDetails,UserA
$mbxr.DisplayName = $_.DisplayName
$mbxr.RecipientType = $user.RecipientType
$mbxr.TotalItemSizeinMB = $TotalSize
$mbxr.QuotaStatus = $st.StorageLimitStatus
$mbxr.UseDatabaseQuotaDefa
$mbxr.IssueWarningQuota = $_.IssueWarningQuota.Value
$mbxr.ProhibitSendQuota = $_.ProhibitSendQuota.Value
$mbxr.ProhibitSendReceiveQ
$mbxr.Itemcount = $st.Itemcount
$mbxr.Email = $_.PrimarySmtpAddress
$mbxr.ServerName = $st.ServerName
$mbxr.Company = $user.Company
$mbxr.Hidden = $_.HiddenFromAddressListsE
$mbxr.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
Get-Mailbox -ResultSize Unlimited to get result for all mailboxes
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.