Quantcast
Channel: Exchange Server 2013 - General Discussion forum
Viewing all articles
Browse latest Browse all 4521

Modifying Powershell script to display mailbox size ?

$
0
0

Hi All,

I need some assistance in modifying the below script to display the total capacity of the mailbox database in the below script:

$xDays = 90
Get-Mailbox -ResultSize 50 -RecipientTypeDetails UserMailbox | Foreach-Object {
         $si = Get-MailboxFolderStatistics $_ -IncludeOldestAndNewestItems -FolderScope SentItems
         if($si.NewestItemReceivedDate -AND (New-TimeSpan $si.NewestItemReceivedDate.ToLocalTime()).Days -ge $xDays) {
            #$_
               New-Object PSObject -Property @{
                     Name = $_.Name
                     Alias = $_.Alias
                         PrimarySmtpAddress = $_.PrimarySmtpAddress
                         WhenCreated = $_.WhenCreated
                         Database = $_.Database
                     	 LastSentItemDate = $si.NewestItemReceivedDate
                         LastLogonTime = $si.LastLogonTime
                         MailboxSize = $si.TotalItemSize.Value
               }
      }
} | Select Name, Alias, PrimarySmtpAddress, LastSentItemDate, WhenCreated, LastLogonTime, Database, TotalItemSize | Sort LastSentItemDate | Export-Csv -Path C:\temp\90Days.csv -NoTypeInformation -UseCulture

Somehow I cannot show the total Item size value in the Exported CSV result ?


/* Server Support Specialist */


Viewing all articles
Browse latest Browse all 4521

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>