mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-10 02:28:57 +02:00
Add list-outlook-sent.ps1
This commit is contained in:
parent
b1106be615
commit
d68df88c4d
23
Scripts/list-outlook-sent.ps1
Normal file
23
Scripts/list-outlook-sent.ps1
Normal file
@ -0,0 +1,23 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists Outlook's Sent Mails
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the mails in the Sent Mail folder of Outlook.
|
||||
.EXAMPLE
|
||||
PS> ./list-outlook-sent
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
$Outlook = New-Object -com Outlook.application
|
||||
$MAPI = $Outlook.GetNameSpace("MAPI")
|
||||
$Inbox = $MAPI.GetDefaultFolder(5) # 5 = olFolderSentMail
|
||||
$Inbox.items | Select SentOn,Subject | Format-Table -AutoSize
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user