Earlier written a Power shell check the mailbox script, you can perfect the Get-mailbox and get-mailboxstatistics together to use. Share to everyone statistics individual user mailbox information, user name replaced by user name to query foreach ($MailBox In (get-mailbox -resultsize unlimited - identity zengchuixin)) { get-mailboxstatistics -identity $MailBox | ' Select-Object ' @{label= "sAMAccountName"; expression={$MailBox .samaccountname}}, ' @{label= "primarysmtpaddress"; expression={$MailBox .primarysmtpaddress}}, ' @{label= "userPrincipalName"; expression={$MailBox .userprincipalname}}, ' @{label= "whencreated"; expression={$MailBox .whencreated}}, ' @{label= "usedatabasequotadefaults"; expression={$MailBox .usedatabasequotadefaults}}, ' @{label= " Prohibitsendreceivequota "; expression={$MailBox .prohibitsendreceivequota}}, ' @{label= "ProhibitSendQuota"; expression={$mailbox.prohibitsendquota}}, ' @{label= "Issuewarningquota"; expression={$MailBox .issuewarningquota}}, ' @{label= "totalitemsize (MB)"; Expression={$_. TotalItemSize.value.ToMB ()}}, ' @{label= "totaldeleteditemsize (MB)"; Expression={$_. TotalDeletedItemSize.value.ToMB ()}}, ' @{label= "totalsize (MB)"; Expression={$_. TotalItemSize.value.ToMB () + $_. TotalDeletedItemSize.value.ToMB ()}}, ' servername,databasename,displayname, deleteditemcount,itemcount,lastlogontime,lastloggedonuseraccount, ' @{label= ' Hiddenfromaddresslistsenabled "; expression={$MailBox .hiddenfromaddresslistsenabled}}, ' @{label= " OrganizationalUnit "; expression={$MailBox .organizationalunit}}, ' @{label= "distinguishedname"; expression={$MailBox .distinguishedname}}, ' @{label= "EmailaDdresses "; expression={$MailBox .emailaddresses}} | ' export-csv -path c:\users \exadmin\desktop\allmailbox.csv -encoding default -notypeinformation} Statistics All user mailbox information foreach ($MailBox In (get-mailbox -resultsize unlimited)) { get-mailboxstatistics -identity $MailBox | ' Select-Object ' @{label= ' sAMAccountName '; expression={$MailBox .samaccountname}}, ' @{label= "primarysmtpaddress"; expression={$MailBox .primarysmtpaddress}}, ' @{label= "userPrincipalName"; expression={$MailBox .userprincipalname}}, ' @{label= "whencreated"; expression={$MailBox .whencreated}}, ' @{label= "usedatabasequotadefaults"; expression={$MailBox .usedatabasequotadefaults}}, ' @{label= " Prohibitsendreceivequota "; expression={$MailBox. Prohibitsendreceivequota}}, ' @{label= "Prohibitsendquota"; expression={$MailBox .prohibitsendquota}}, ' @{label= "Issuewarningquota"; expression={$MailBox .issuewarningquota}}, ' @{label= "totalitemsize (MB)"; Expression={$_. TotalItemSize.value.ToMB ()}}, ' @{label= "totaldeleteditemsize (MB)"; Expression={$_. TotalDeletedItemSize.value.ToMB ()}}, ' @{label= "totalsize (MB)"; Expression={$_. TotalItemSize.value.ToMB () + $_. TotalDeletedItemSize.value.ToMB ()}}, ' servername,databasename,displayname, deleteditemcount,itemcount,lastlogontime,lastloggedonuseraccount, ' @{label= ' Hiddenfromaddresslistsenabled "; expression={$MailBox .hiddenfromaddresslistsenabled}}, ' @{label= " OrganizationalUnit "; expression={$MailBox .organizationalunit}}, ' @{label= "distinguishedname"; expression={$MailBox .distinguishedname}}, ' @{label= "emailaddresses"; expression={$MailBox .emailaddresses}} | ' export-csv -path c:\users \exadmin\desktop\allmailbox.csv -encoding default -notypeinformation} Count all mailboxes under one OU to modify the path of the OU to the path of the OU that you want to query for your company foreach ($MailBox In (get-mailbox -organizationalunit "Ou= account, ou=test,dc=contoso,dc=local" -resultsize unlimited)) { get-mailboxstatistics -Identity $MailBox .name | ' Select-Object ' @{ Label= "sAMAccountName"; expression={$MailBox .samaccountname}}, ' @{label= "primarysmtpaddress"; expression={$MailBox .primarysmtpaddress}}, ' @{label= "userPrincipalName"; expression={$MailBox .userprincipalname}}, ' @{label= "whencreated"; expression={$MailBox .whencreated}}, ' @{label= "usedAtabasequotadefaults "; expression={$MailBox .usedatabasequotadefaults}}, ' @{label= " Prohibitsendreceivequota "; expression={$MailBox .prohibitsendreceivequota}}, ' @{label= "ProhibitSendQuota"; expression={$MailBox .prohibitsendquota}}, ' @{label= "Issuewarningquota"; expression={$MailBox .issuewarningquota}}, ' @{label= "totalitemsize (MB)"; Expression={$_. TotalItemSize.value.ToMB ()}}, ' @{label= "totaldeleteditemsize (MB)"; Expression={$_. TotalDeletedItemSize.value.ToMB ()}}, ' @{label= "totalsize (MB)"; Expression={$_. TotalItemSize.value.ToMB () + $_. TotalDeletedItemSize.value.ToMB ()}}, ' servername,databasename,displayname, deleteditemcount,itemcount,lastlogontime,lastloggedonuseraccount, ' @{label= ' Hiddenfromaddresslistsenabled "; expression={$MailBox. Hiddenfromaddresslistsenabled}}, ' @{label= "organizationalunit"; expression={$MailBox .organizationalunit}}, ' @{label= "distinguishedname"; expression={$MailBox .distinguishedname}}, ' @{label= "emailaddresses"; expression={$MailBox .emailaddresses}} | ' export-csv -path c:\users \exadmin\desktop\public.csv -encoding default -append -notypeinformation}
This article from "Zeng Hung Xin Technical column" blog, declined to reprint!
PowerShell Statistics mailbox Account information