Last active
December 5, 2018 10:12
-
-
Save gioxx/7b7348c81ff33fe8d23fa7a59180432e to your computer and use it in GitHub Desktop.
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 https://wp.me/pdQ5q-9W3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# O365 PShell Snippet: Get oldest message in a Mailbox | |
Autore (ver.-mod.): GSolone (0.1 ult.mod. 21/11/18) | |
Utilizzo: .\OldestMail.ps1 user@contoso.com | |
Info: https://gioxx.org/tag/o365-powershell | |
#> | |
# Verifica parametri da prompt | |
Param( | |
[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