Powershell Get-MailboxStatistics -How to get e-mail address from mailboxes
Hi all,
I have created a little powershell script that lists all mailboxes, which is running out of space.
My issue is that i want to list the users e-mail address, but icant get this using Get-MailboxStatistics. Im sure i need to use the commandlet with Get-Mailbox, but i cant figure out how to combine it.
Any advice?
Get-MailboxServer | Get-MailboxStatistics
| where{$_.StorageLimitStatus
-notlike
"BelowLimit"}
| where{$_.DisconnectDate
-eq
$null}|
select
DisplayName,
@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},
StorageLimitStatus, LastLogonTime,DeletedItemCount
February 10th, 2011 10:09am
You can use the below set. There may be punctuation errors. check out
Get-MailboxServer | Get-Mailbox | foreach-object {$email = $_.primarysmtpaddress; $_ | Get-MailboxStatistics |
where{$_.StorageLimitStatus
-notlike
"BelowLimit"}
| where{$_.DisconnectDate
-eq
$null}|
select
DisplayName,
@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},
StorageLimitStatus, LastLogonTime,DeletedItemCount,@{Name="EmailAddress";expression={$email}}}
Free Windows Admin Tool Kit Click here and download it now
February 11th, 2011 5:44am
Worked perfectly, Thanks alot :)
February 14th, 2011 3:49am
You can use the below set. There may be punctuation errors. check out
Get-MailboxServer | Get-Mailbox | foreach-object {$email = $_.primarysmtpaddress; $_ | Get-MailboxStatistics |
where{$_.StorageLimitStatus
-notlike
"BelowLimit"}
| where{$_.DisconnectDate
-eq
$null}|
select
DisplayName,
@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},
StorageLimitStatus, LastLogonTime,DeletedItemCount,@{Name="EmailAddress";expression={$email}}}
This is a great script. I used it and got a warning. I have 1300 mailboxes. How I can get all mailboxes using this script? I can't put -Results Unlimited parameter in the right way.
Free Windows Admin Tool Kit Click here and download it now
February 17th, 2011 5:33pm
On Thu, 17 Feb 2011 22:17:27 +0000, Valentin Miranda wrote:
>>You can use the below set. There may be punctuation errors. check out
>>
>>Get-MailboxServer | Get-Mailbox | foreach-object {$email = $_.primarysmtpaddress; $_ | Get-MailboxStatistics | where{$_.StorageLimitStatus -notlike "BelowLimit"} | where{$_.DisconnectDate -eq $null}| select DisplayName, @{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},
StorageLimitStatus, LastLogonTime,DeletedItemCount,@{Name="EmailAddress";expression={$email}}}
>This is a great script. I used it and got a warning. I have 1300 mailboxes. How I can get all mailboxes using this script? I can't put -Results Unlimited parameter in the right way.
You can't add "-resultsize unlimited" to the "Get-Mailbox"?
---
Rich Matheisen
MCSE+I, Exchange MVP
--- Rich Matheisen MCSE+I, Exchange MVP
February 17th, 2011 11:22pm