I need to query my inbox with powershell recursivly for all "undelivered email returner"...
I have problems with the recursive part...
This is what I got:
$outlook = new-object -com Outlook.Application
$ns = $olApp.GetNamespace("MAPI")
$mb = $namespace.Folders | ?{$_.name -match "mailbox"}
$folder1 = $mb.Folders | ?{$_.name -match "folder1"}
$folder1.Folders | %{$_.name}
$folder1.items | foreach {
if($_.subject -match "undelivered") {...}
}
This is what I got ... but I have some sort of problem with the recursive part in scripting..
any help would be greate...
thanks