Skip to content

Instantly share code, notes, and snippets.

@gioxx gioxx/OldestMail.ps1
Last active Dec 5, 2018

What would you like to do?
Restituisce la data (e la cartella in cui è contenuto) il messaggio più vecchio mai ricevuto all'interno di una casella di posta elettronica Office 365, vedi
<# O365 PShell Snippet: Get oldest message in a Mailbox
Autore (ver.-mod.): GSolone (0.1 ult.mod. 21/11/18)
Utilizzo: .\OldestMail.ps1
# Verifica parametri da prompt
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
[string] $SourceMailbox
Get-MailboxFolderStatistics -IncludeOldestAndNewestItems -Identity $SourceMailbox |
Where OldestItemReceivedDate -ne $null |
Sort OldestItemReceivedDate |
Select -First 1 OldestItemReceivedDate,FolderPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.