Announcement

Collapse
No announcement yet.

Get-MailboxSizes.PS1 does not return data

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Get-MailboxSizes.PS1 does not return data

    I am using Exchange 2010, when I run the script to get mailbox sizes in Powershell :

    Get-MailboxStatistics | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{labe l=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}}, @{label=”Items”;expression={$_.ItemCount}},@{label =”Storage Limit”;expression={$_.StorageLimitStatus}} -auto

    I get the following return:

    [PS] D:\Exchange Server\Scripts>.\Get-MailboxSizes.ps1

    cmdlet Get-MailboxStatistics at command pipeline position 1
    Supply values for the following parameters:
    Identity:

    So it is asking me for a single user name when I want to return all users. Could this have anything to do with having my Exchange Server folder on the D: volume? Thank you.

  • #2
    Re: Get-MailboxSizes.PS1 does not return data

    You need to get-mailbox first. Something like:

    get-mailbox | get-mailboxstatistics etc.

    Test each bit separately.
    Here is something similar you may be able to adapt:
    Code:
    #Get-ExchangeStats.ps1
    #T Jones June 2010
    
    $c+= get-date -format ddMMyy
    $c+= "_"
    get-mailbox | get-mailboxstatistics | 
    select-object servername, databasename,  DisplayName, @{expression={$_.TotalItemSize.Value.ToKB()}},StorageLimitStatus,LastLogonTime, LastLoggedOnUserAccount,ItemCount, DeletedItemCount, legacydn   | 
    export-csv -path ("o:\"+$c+"exchangeuserstats.csv")
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment

    Working...
    X