Add-type -assembly "Microsoft.Office.Interop.Outlook" | Out-Null
$oLFolders = "Microsoft.Office.Interop.Outlook.OlDefaultFolders" -as [type]
$outlook = New-Object -ComObject Outlook.Application
$namespace = $outlook.GetNamespace("MAPI")
$deleted = $namespace.Folders.Item('first.last@domain.com').Folders.Item("Deleted Items")
cls
while(1){
$deleted.Folders | %{
Write-Host $_.Name -fore Magenta
$_.Folders | %{
Write-Host " "$_.Name -fore Cyan
$_.Delete()
}
$_.Delete()
}
cls
}
I am using this, and it's quite effective.
I am also pointing this to the Archive, which is "Online Archive - first.last@domain.com"