Lost folder - how to find it
How many times does a user accidentally move a folder and panics when they can't find it? Well, it would be nice if Outlook search wouldfind folder names, but since it doesn't try the following Powershell script:
$alias=Read-Host"Enterthemailbox"
$strSearch=Read-Host"Enterthefoldertolocate"
$strSearch=$strSearch.ToLower()
$FolderList=Get-MailboxFolderStatistics$alias|Select-ObjectName,FolderPath
ForEach($Folderin$FolderList)
{$strFolder=[string]$Folder.Name
$strFolder=$strFolder.ToLower()
if($strFolder.Contains($strSearch)-eq$true)
{$message=$strSearch+"islocatedat"+[string]$Folder.FolderPath
Write-Host$message
break
}
}
January 22nd, 2009 12:47am
Nice sharing Jim... This can be done with single liner too... :)Get-MailboxFolderStatistics "Mailbox Name" | Where{$_.name -eq "Search Folder"} | FT Name, FolderPathAmit Tank | MVP - Exchange | MCITP:EMA MCSA:M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
January 22nd, 2009 6:48am
Yes, thanks. I looked at the foreach and realized that was just a nice filter for the where clause.
January 22nd, 2009 4:33pm