Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

mailbox size exchange 2007

$
0
0

Hi,

I have Exchange 2007, I get a list of users in TEXT file and I need to get a table like this:

display name       mailbox size(MB)         Issue Warning Quota(MB)

user1                    25                                  40

 

I wrote those lines:

Add-PSSnapin -Name Microsoft.Exchange.Management.PowerShell.Admin

$file=Get-Content c:\mail.txt

foreach ($mail in $file) {

Get-MailboxStatistics -Identity $mail | Sort -Property DisplayName | ft -AutoSize  DisplayName, @{expression={$_.totalitemsize.value.ToMB()};label="Mailbox Size(MB)"},|Out-File c:\mailboxes.txt -Append

}

1) I know that I can'y get "IssueWarningQuota" with this command, I need to use "Get-MailBox",     I don't know how to add it to the output file.

2) when I run the command in the output file the headers are been duplicate in every user, how     can I  avoid that?

 

Thanks,

Lior

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles