Wie kann ich den Inhalt einer Email in Powershell anzeigen?
$Outlook = New-Object -ComObject Outlook.Application
$Namespace = $Outlook.GetNamespace("MAPI")
$inbox = $Namespace.GetDefaultFolder(6) # Posteingang
$customFolder = $inbox.Folders | Where-Object { $_.Name -eq "CommVault" }
foreach ($Email in $customFolder.Items) {
Write-Host "Betreff: $($Email.Subject)"
Write-Host "Absender: $($Email.SenderName)"
Write-Host "Empfangsdatum: $($Email.ReceivedTime)"
Write-Host "-----------------------------------"
}
$Outlook.Quit()