?
Solved

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

Posted on 2011-10-18
3
Medium Priority
?
1,084 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:datacomsmt
3 Comments
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 36990849
Try to run this syntax in EMS

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

Regards,
Krzysztof
0
 
LVL 14

Accepted Solution

by:
Radweld earned 2000 total points
ID: 36990864
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
 
LVL 3

Expert Comment

by:LindyS
ID: 36991082
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
How to effectively resolve the number one email related issue received by helpdesks.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question