#Last Email Received Report
========================
========================
$Mailboxes = Get-Mailbox -RecipientTypeDetails UserMailbox,SharedMailbox
$Output=$null
$Output=[System.collections.Arraylist]@()
$Mailboxes|ForEach{
$Property=[pscustomobject]@{
Name = $_.Name
LastEmailReceivedOn = (Get-MessageTrackingLog -EventId "Receive" -Recipients $_.UserprincipalName|Select TimeStamp -last 1).TimeStamp
}
$Output.Add($Property)
}
$Output
#$Output|?{$_.LastEmailReceivedOn -ne $null}|sort LastEmailReceivedOn
#Last Email Sent Report
========================
$Mailboxes = Get-Mailbox -RecipientTypeDetails UserMailbox,SharedMailbox
$Output=$null
$Output=[System.collections.Arraylist]@()
$Mailboxes|ForEach{
$Property=[pscustomobject]@{
Name = $_.Name
LastEmailSentOn = (Get-MessageTrackingLog -EventId "Send"-Sender $_.UserprincipalName|Select TimeStamp -last 1).TimeStamp
}
$Output.Add($Property)
}
$Output
$Mailboxes = Get-Mailbox -RecipientTypeDetails UserMailbox,SharedMailbox
$Output=$null
$Output=[System.collections.Arraylist]@()
$Mailboxes|ForEach{
$Property=[pscustomobject]@{
Name = $_.Name
LastEmailSentOn = (Get-MessageTrackingLog -EventId "Send"-Sender $_.UserprincipalName|Select TimeStamp -last 1).TimeStamp
}
$Output.Add($Property)
}
$Output
No comments:
Post a Comment