Powershell Script to output in CSV Format: ExcDisplayName , Last logon/Activity, TotalItemSize(KB), ItemCount

HI

Mailbox Server Name: Exch01.. (Exchange 2007 SP3 Environment)
Domain Name: Contoso.local
DC Name: ContosoDC1

I need a powershell script that outputs in CSV format on mailbox the following info:


DisplayName (i.e Mailbox Name),
Last logon/Activity,
TotalItemSize(KB),
ItemCount
datacomsmtAsked:
Who is Participating?
 
RadweldCommented:
Sometime like get-mailbox | get-mailboxstatistics | ft (the values you want to view separated by ,) | export-Csv (filename)

I'm on my phone I'm sure someone else can verify the exact attributes to search for.
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
Try to run this syntax in EMS

Get-MailboxStatistics | fl DisplayName,LastLogonTime,TotalItemSize,ItemCount | Export-CSV c:\output.csv

Regards,
Krzysztof
0
 
LindySCommented:
This is what I use. It outputs a txt file, but it opens with Excel easily.
It only returns connected mailboxes.

Get-ExchangeServer 'ServerPrefix*' |? {$_.serverrole -match "Mailbox"} | Get-MailboxStatistics | Where-Object { $_.DisconnectDate -eq $null } | Format-Table -AutoSize Database, @{label=”User”;expression={$_.DisplayName}}, @{label="Last Logged On By";expression={$_.LastLoggedOnUserAccount}}, @{label="Item Count";expression={$_.ItemCount}}, @{expression={$_.totalitemsize.value.ToMB()};label="Size (MB)"}, @{label=”Storage Limit”;expression={$_.StorageLimitStatus}}, @{label="Last Logon";expression={$_.LastLogonTime}}, @{label="Last Logoff";expression={$_.LastLogoffTime}} | Out-File  filename.txt -width 375
   

 [  

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.