mailbox last logon times


Script to list mailbox last logon times

$mail = Get-mailbox | ?{$_.RecipientTypeDetails -eq "UserMailbox" -and $_.DisplayName.substring(0,4) -ne "CAS_"} | get-MailboxStatistics |Select-Object Displayname,LastLogontime |Sort-Object Lastlogontime #|Export-Csv c:\mm.csv
$mailDisplay = $mail.Displayname
$mailLastlogon = $mail.LastLogonTime
$recipienttype = $mail.RecipientTypeDetails
 
$result = [string]::Join(',',($mailDisplay,$mailLastlogon))
$result
$mail |Export-Csv c:\mm.csv

 

What did you think of this article?




Trackbacks
  • No trackbacks exist for this post.
Comments
  • No comments exist for this post.
Leave a comment

Submitted comments are subject to moderation before being displayed.

 Name

 Email (will not be published)

 Website

Your comment is 0 characters limited to 3000 characters.