datacomsmt
asked on
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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= {$_.Displa yName}}, @{label="Last Logged On By";expression={$_.LastLog gedOnUserA ccount}}, @{label="Item Count";expression={$_.Item Count}}, @{expression={$_.totalitem size.value .ToMB()};l abel="Size (MB)"}, @{label=”Storage Limit”;expression={$_.Stor ageLimitSt atus}}, @{label="Last Logon";expression={$_.Last LogonTime} }, @{label="Last Logoff";expression={$_.Las tLogoffTim e}} | Out-File filename.txt -width 375
[
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=
[
I am all late with this but is there a way to run this same powershell but ONLY look at certain databases? Reason being we have 3 exchange databases and I am only interested in two of them. The third one is a former Employee database and I dont need to see 5000 unnecessary details.
Get-MailboxStatistics | fl DisplayName,LastLogonTime,
Regards,
Krzysztof